Skip to main content

Env config viewer

Outcome​

A platform admin can confirm the env vars in effect on the running admin-service instance, with a hard-redaction policy on secret-shaped keys — without shell access.

Prerequisites​

  • PLATFORM_ADMIN or PLATFORM_SUPPORT (gated by requirePlatformAuth()).

Surface​

ElementWhere
Page/env-config on the platform console (admin.<env>.medsuiteone.ai)
EndpointGET /platform/env-config returns { generatedAt, nodeEnv, nodeVersion, processUptimeSec, entries } where each entry is { key, group, description, isSecret, isSet, isDefault, value, defaultValue }.
Catalog sourceapps/admin-service/src/gateway/routes/env-config-catalog.ts — this service's own allowlist, of the env vars apps/admin-service/src/config.ts consumes. There are two catalogs in the repo and the console reads admin-service's; rcm-core keeps its file but no longer serves an env-config route at all.

Redaction policy​

The redactEnvValue helper in packages/platform-identity/src/routes/env-config-report.ts is the single point of truth:

Entry kindvalue on the wire
Secret (isSecret=true)Always null, regardless of whether the var is set or falls back to default. Even baked-in dev defaults (e.g. JWT_SECRET fallback) are masked.
Non-secretRaw string from process.env[key] when set, otherwise the catalog default.
defaultValueAlways passed through (catalog defaults are repo-public).

The integration test tests/integration-pg/src/ui28-platform-env-config.int.test.ts asserts that the seeded plaintext secret never appears anywhere in the response — keep this assertion in place if the catalog surface evolves.

When to use​

ScenarioWhat you do
Confirming a deploy"Did the new DASHBOARD_EMAIL_INTERVAL_MS actually land?" — the page shows source = env vs default. An unset override surfaces as default.
Outage triageQuick check that KEY_VAULT_MODE, AZURE_SERVICE_BUS_CONNECTION_STRING, or INGESTION_JOBS_ENABLED are configured the way the runbook expects, without container shell access.
OnboardingOperators without direct K8s/ACA access can still sanity-check what's wired up.

Adding a new env var​

  1. Add a row to ENV_CONFIG_CATALOG with the right group, defaultValue, description, and an honest isSecret flag.

  2. Run the catalog test:

    npx vitest run packages/platform-identity/src/routes/env-config-report.test.ts
    npx vitest run apps/admin-service/src/gateway/routes/env-config-catalog.drift.test.mjs

    The first guards redaction; the second keeps the catalog in step with the service config — duplicate keys and naively non-redacted "secret-shaped" names both fail.

  3. Restart the running admin-service process. The viewer reflects the process.env snapshot at request time, so changes take effect on the next refresh.

What's out of scope​

  • Runtime-editable feature flags. The viewer is read-only by design. A flag-service item would be a separate scoped roadmap row.
  • Other processes' env visibility. This page reports the running admin-service process only — not rcm-core, not edi-gateway. Confirm those via their own /health endpoints or container env inspection.
  • Diff vs previous deploy. Would require persisting a startup snapshot — out of scope.

Validation​

CheckExpected
Secret entries on the wirevalue: null regardless of isSet
Non-secret entry under fallback defaultvalue reflects catalog default
Catalog testGreen
Adding a new env var without catalog rowVisible in process.env but not in the page (intentional gating)

Cross-references​

Next​

End of the runbook — return to the Operations overview.