Expand resolution result into multiple variables
A resolve config could trigger a process which returns several pieces of information, for example as JSON or env file format. This module could expand this output and write each attribute into a prefixed request environment variable, in the same way mod_auth_openidc writes claims into environment variables.
A use case could be that resolving sub@iss
returns several pieces of information about the user including their UID, GID, username and list of supplemental groups.
Interface for returning multiple values
-
env file format (
<variable>=<value>
lines). This primitive format allows to specify multiple (one-line) values. A parser could probably be implemented quite easily, but there is little consistency in terms of quoting, escape characters, ... between other existing solutions. That means documentation should be precise so that users do not run into ambiguities. -
JSON object. For parsing an additional library would be required, but most modern languages (not C/C++) include support for writing and parsing JSON. The returned JSON object must only have "simple" keys - no arrays or objects - and perhaps only strings should be allowed due to ambiguities with encoding numbers and bools to strings.
Storing returned variables
The simplest way to store all returned variables is to prefix those with a user-configurable string.
The final names would be <prefix><returned_name>
for each returned variable.