Skip to main content

Auth Governance Platform Documentation

This is the single, unified documentation for governance and authorization across the platform.

Purpose

Describe how access governance is implemented end-to-end, including identity, hierarchy, policy evaluation, contract boundaries, gateway exposure, auditability, and release controls.

Platform scope

  • IAM identity and internal verification surface.
  • Hierarchy/DAG context used for node-scoped authorization.
  • Access-policy decisioning (RBAC + ABAC) and policy administration.
  • Config-resolver orchestration of governance dependencies.
  • Kong internal/public route exposure for governance-related APIs.
  • Decision trace and break-glass governance evidence.
  • Session facility context: IAM/BFF SHOULD expose a stable hierarchy nodeId (e.g. contextNodeId) for Config Resolver callers; see IAM SPEC §7 and config-resolver SPEC §8.
  • Tenant branding vs resolver tokens: Precedence when both apply is defined in config-resolver SPEC §8 and Tenant SPEC (TenantConfiguration note).

Core architecture

Services and responsibilities

  • apps/services/iam: user identity, verification, internal lookup APIs.
  • apps/services/hierarchy: DAG nodes, ancestry, membership context.
  • apps/services/access-policy: access evaluation, context, roles, permissions, policies.
  • apps/services/config-resolver: effective config and governance dependency integration.
  • apps/services/config-resolver: effective config and governance dependency integration. It orchestrates licensing, flags, role expansion, and UI/tokens, and calls Access Policy’s POST /internal/access/evaluate for ABAC. It does not replace Access Policy as the system of record for authorization decisions (see config-resolver AS_BUILT_AND_ROADMAP §2).
  • apps/services/platform-admin: feature flags and bootstrap controls.
  • apps/services/terminology: terminology contracts used by governed clinical flows.

Governance contract principles

  • Internal contracts are explicit and versioned through shared types.
  • Access evaluation requires explicit actor and tenancy context.
  • No compatibility facade layer for core governance contracts.
  • Contract changes require synchronized producer/consumer updates and tests.

Access governance flows

Authentication and service trust

  • Identity is established via JWT and validated in service guards.
  • Internal routes are network-restricted at Kong policy level.
  • Service-to-service calls rely on explicit internal contract paths.

Authorization lifecycle

  1. Caller submits access intent with tenancy and subject context.
  2. Access-policy evaluates action/resource with role and policy context.
  3. Response includes decision metadata (decisionTraceId, evaluatedAt).
  4. Downstream handler proceeds only on allow.
  5. Audit and governance evidence is emitted/persisted for governed operations.

End-to-end data flow

Break-glass governance

  • Break-glass request context is accepted in evaluate inputs.
  • Governance evidence (reason, TTL, step-up metadata, trace linkage) is persisted.
  • Schema-backed storage is implemented via break_glass_events.

Contract and route alignment status

Access Policy: licensing vs orchestration

  • When LICENSING_INTERNAL_URL (or LICENSING_URL) is set, the Access Policy service performs a node-scoped module entitlement check inside evaluate() (via GET /internal/licenses/check) before RBAC and ABAC policy rules. Resource types map to module keys in apps/services/access-policy/src/resource-module-map.ts.
  • When licensing is not configured (common in local dev), evaluate() relies on DENY/ALLOW policies + RBAC only. Config Resolver still orchestrates licensing, flags, and POST /internal/access/evaluate in full platform flows; any direct caller of Access Policy must enforce licensing at the boundary if this service runs without a licensing URL.
  • Hierarchy: role assignments match the resource node or any ancestor (GET /internal/hierarchy/nodes/:nodeId/ancestors), implemented by HierarchyClient in access-policy.

Governance-related contract backlog is closed.

  • Q1 foundational contract alignments are completed.
  • Q2 implementation items (break-glass persistence, bootstrap endpoint drift, allergies internal mapping) are completed.
  • Q3 closure items (terminology internal contract path, facade removal, gateway policy checks) are completed.

Gateway policy model (Kong)

  • Required governance internal surfaces are mapped and tested in both:
    • infra/kong/kong.yml
    • infra/kong/kong.dev.yml
  • Deprecated/stale governance paths are explicitly blocked by declarative checks.
  • Dev/prod policy deltas are explicitly asserted and controlled.

Personas and access posture

PersonaTypical Role KeysAccess CharacteristicsGovernance Controls
Platform OperatorSUPER_ADMIN, platform admin rolesCross-tenant configuration and oversight operationsExplicit high-privilege permissions, audited admin actions
Tenant AdminTENANT_ADMINTenant-scoped governance and user/role administrationTenant boundary enforcement, audited role/policy changes
Clinical ProviderPHYSICIAN, NURSE, clinical rolesPatient-care actions in assigned node/facility scopeLicense gate, role grants, ABAC evaluate, minimum-necessary
Compliance/AuditorAUDITORRead-focused oversight and evidence reviewRead-only policy, audit export controls, no write privileges
Emergency Override ActorAssigned clinical role + approved break-glass pathTemporary elevation for urgent care scenariosReason taxonomy, TTL, step-up metadata, persisted evidence

Access evaluation matrix (practical)

Check StageInput SignalsDecision RuleOutcome on Fail
Identity validationJWT subject, tenant, signatureToken must be valid and service-trustedDeny request
Module entitlementmoduleKey, nodeIdModule must be active for node scope/inheritanceDeny request
Feature flagfeatureKey, tenantIdFeature must evaluate enabledDeny request
Role/permission baselineuser roles + role grantsRequired action/resource permission must existPreliminary deny
Policy evaluate (/internal/access/evaluate)userId, tenantId, action, resourceType, nodeId, governance fieldsABAC/RBAC policy result is authoritative for governed actionDeny with trace
Explicit override layeruser-node override recordsValid explicit allow/deny may override baseline within scopeApply override result
Break-glass governancereason, TTL, step-up metadataIf enabled, evidence must be captured with trace linkageReject or deny based on policy/validation
Audit evidencedecision trace + action metadataGoverned action must emit traceable evidenceRelease gate failure / control violation

Break-glass lifecycle flow

Verification and release controls

  • Governance contract assertions are enforced by declarative Kong tests.
  • Targeted client/provider tests exist for high-risk governance contracts.
  • Release gates require contract integrity and decision-trace consistency for governed actions.

Canonical references outside this document

  • Baseline architecture: specs/architecture/baseline/ARCHITECTURE_BASELINE.md
  • Security/compliance: specs/architecture/platform/COMPLIANCE_SECURITY.md
  • Module-level specs: specs/modules/

Current status

Auth governance alignment is complete at the architecture/documentation level in this repository.

For module-specific resolver behavior and concrete examples, see specs/modules/config-resolver/CONFIG_MODEL.md.