As an Admin I want to see the environment variables the running backend was started with so that I can verify that a deployment is configured as expected without shell access to the server.
Assumptions & Constraints
- The values are read from the process environment of the running JVM, so they describe the container the application was started in and change only when it is restarted.
- Which variables are exposed is decided by configuration, not by the caller: a caller cannot ask for a key that the configuration does not allow.
- Values are returned as they are, without masking, therefore a variable that holds a secret has to be excluded by configuration rather than hidden at response time.
- A variable that is set to an empty value and a variable that is not set at all are different states and must not be conflated.
- The set of variables is small enough to be returned in a single response, so pagination is not needed.
Preconditions
- Role based access control is in place and an ADMIN role exists.
- The application is deployed with its configuration supplied through environment variables.
Business rules
- Only an ADMIN can call this endpoint.
- Exposure is controlled by an access mode: ALL returns every variable, WHITELIST returns only the explicitly listed keys, BLACKLIST returns every variable except the explicitly listed keys.
- In WHITELIST mode a key that is not listed is never returned, even when it exists in the environment.
- In BLACKLIST mode a listed key is never returned, even when it exists in the environment.
- A configuration that contradicts itself, for example access mode ALL together with a configured key list, is a configuration error and must fail the application startup rather than be silently ignored.
- Every call is written to the application log together with the id of the admin who made it.
Acceptance Criteria
- GET /api/v1/admin/environment-variables returns the environment variables of the running application as a JSON object of key to value.
- A caller without the ADMIN role receives 403 and no data.
- An unauthenticated caller receives 401.
- With access mode WHITELIST only the listed keys are returned, and a listed key that is absent from the environment is simply not present in the response.
- With access mode BLACKLIST every variable except the listed keys is returned.
- With access mode ALL every variable is returned.
- Starting the application with access mode ALL together with a configured key list fails with a clear error message.
- Each call is logged together with the id of the calling admin.
- The endpoint is not documented in Swagger.
Out of scope
- Any UI work.
- Retrieving a single variable by its key.
- Masking or partially redacting values.
- Changing, adding or removing environment variables at runtime.
- Exposing Spring configuration properties: only process environment variables are covered.
Epic link
Epic #<EPIC_NUMBER>
Tasks
- #<TASK_NUMBER>
As an Admin I want to see the environment variables the running backend was started with so that I can verify that a deployment is configured as expected without shell access to the server.
Assumptions & Constraints
Preconditions
Business rules
Acceptance Criteria
Out of scope
Epic link
Epic #<EPIC_NUMBER>
Tasks