For an app served by the portal under /app/<id>/ or /api/<id>/.
The proxy adds the identity to each request when the app's spec opts in:
Value
An identity (see has_group()), or NULL for an anonymous
visitor — or when the spec has not enabled the headers.
Details
| Spec setting | Header | Identity field |
add-default-http-headers: true | X-SP-UserId | username |
X-SP-UserGroups (comma-separated) | groups | |
identity-claims: [email] | X-Ruscker-User-Email | email |
identity-claims: [setor] | X-Ruscker-User-Setor | setor |
identity-claims: [roles] | X-Ruscker-User-Roles | group_roles |
Why the values can be trusted: the proxy removes any X-SP-* and
X-Ruscker-User-* header that arrives from outside, so a value the app
sees was put there by the portal. That only holds when the app is
reachable only through the portal.
Read identity per request, never from an environment variable: one container may serve many people.
The headers carry no permanent account id, so sub and name are
always NULL here; key on username. An app restricted to some groups
receives only those groups' roles.