Architecture / Decision records / ADR-HIS-070
ADR-HIS-070 The shared ESS components sign-on and Break-the-Glass: built in their screen folders behind ports, mounted by the shell¶
| Status | Accepted |
| Decided | 2026-11-26 by session RC-1-S23 |
| Record | Drafted 2026-11-26; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | web/domains/ess/UI-ESS-001/ (index.ts, authenticator.ts, SessionGate.tsx); web/domains/ess/UI-ESS-004/ (index.ts, quick-factor.ts, EmergencyAccessGate.tsx, session-control.ts) |
Context¶
D10-ESS section 6.1 makes sign-on and step-up (UI-ESS-001) and the access-restricted and Break-the-Glass dialogue with its session indicator (UI-ESS-004) shared components that "look and behave the same in every domain's application". The shell wraps itself in sign-on, puts the emergency access flag in its global bar and patient context zone, and opens the dialogue wherever a record answers "Deny, emergency override available".
The screen session RC-1-S23 builds both, but its card allows changes only in the folders of its screens. The shell's README says the shell is changed by "the sessions of the shared components", and ADR-HIS-042 says their place will be useShell(). Neither says how a component built in a screen folder reaches the shell, and no other screen may import from a screen folder (session rule 10). What was open:
- How the shell mounts a shared component that lives in
web/domains/ess/. - How UI-ESS-001 binds to the identity provider. Sign-on is OpenID Connect against Keycloak, realm
his(DEC-ESS-005; the token profile ofcontracts/ess/README.md), notidentity.v1. The brief draws sign-on, second factor, step-up, lock and fast user switch as in-application views. A password grant would let the application take the password, but it cannot carry a second factor and the OAuth 2.0 security best practice excludes it. The badge PIN is not yet a credential of FR-ESS-IAM-002 (PH-03, ruling 1). - How UI-ESS-004 uses "the step-up part of UI-ESS-001 inside the same dialogue" when it may not import from that folder.
- How a domain screen tells the dialogue why access was refused. The common 403
Problemcarries no outcome and nodecisionId, anddecideofpolicy-decision.v1is for registered service identities only.
Decision¶
- Each shared component is a library in its own screen folder, with an
index.tsas its public surface. The shell, which already bundles every workspace (ADR-HIS-042), imports thatindex.ts. No screen imports it. - UI-ESS-001 exports
SessionGate, which wraps the shell, andSessionContent, the slot around the content area and action bar where views 3, 6 and 7 are drawn. Neither covers the global bar, the patient context zone or the system banner (CUX-01). - UI-ESS-001 also exports
useWorkforceSession(), withstepUp,lock,requestSignOutandsessionRevoked, andQuickFactorField. - UI-ESS-004 exports
EmergencyAccessGate, which a domain screen wraps around a record it could not open, andEmergencyAccessIndicatorwithindicatorFlagfor the zone, the bar and the handheld band. - UI-ESS-004 also exports the session control the shell calls at sign-out, at a fast user switch and on the same user's return.
- A preview registration, not a route. Each folder's
screen.tsregisters a preview markedexampleandnav: false, so it is never in a production build. The components are reached through the shell's mounting, never as screens. - UI-ESS-001 talks to the identity provider through a port,
Authenticator. The views hand what the user enters to the port and show what it answers. - The outcomes are deliberately coarse. A failed sign-on is one outcome (PR-IAM-002-4). Every account that cannot sign on is "not available".
- The views never store, log or show a credential, and clear it once the port has answered.
- The shell supplies the adapter that binds the port to Keycloak. That adapter uses the authorization code flow with PKCE, never the password grant.
- Whether the adapter drives Keycloak's own pages, themed to these views, or an authentication flow Keycloak exposes for in-application views, is the adapter's decision. That decision comes with the badge PIN, once it is added as a factor (PH-03 ruling 1).
- A synthetic adapter in the folder serves the preview and the tests only.
- Slots instead of imports between the two folders. UI-ESS-004 names the shape of its quick factor (
quick-factor.ts), and UI-ESS-001'sQuickFactorFieldhas that shape. The shell passes one into the other. Step-up is offered to screens in the shape the first screens already use (ServiceSettings.stepUpof UI-ISE-007): the stepped-up credential is used for one call only. - The restriction is an input.
EmergencyAccessGatetakes aRestrictionfrom the domain screen:override-available(withresourceType,decisionIdandaccessChecksUnavailable),role-not-permittedorexcluded-category. A domain learns it from its own enforcement point until the commonProblemcarries it. The reason codes (CFG-ESS-006) and the window (CFG-ESS-007) are inputs too, which the host resolves from configuration.
Rationale¶
The card's boundary keeps the change to the screen folders, and the shell can take the components without changing what they do. Building them as libraries with an explicit public surface means the shell session that mounts them changes only the shell. Testing them in their folders, against the synthetic adapter and the ESS contract stub, means the behaviour the specification asks for is checked before the shell exists.
A port for authentication keeps two things apart: the views, which the brief settles, and the binding to Keycloak, which depends on how the badge PIN becomes a factor. That decision is not taken yet, so fixing the binding now would decide it by accident. Slots keep the two folders independent, as session rule 10 requires, while the dialogue still shows one quick factor in one frame (OV-24).
Consequences¶
- A shell session mounts both components:
- wrap the shell in
SessionGateand the content area inSessionContent; - put
indicatorFlaginPatientContextState.flagsand the indicator in the global bar; - pass
QuickFactorFieldtoEmergencyAccessGate, and call the session control at sign-out, user switch and return; - set each component's service settings and offer
stepUpthrough the SDK.
Until then the components run only in their previews and tests.
- The Keycloak adapter of Authenticator is still to be written, with the badge-PIN factor (platform, Keycloak realm his). The development realm still lacks the MFA claims acr and amr (RC-1-S01, RC-1-S03 follow-ups).
- contracts/common should carry the "override available" outcome and the decisionId on a 403, so that every domain screen can fill the Restriction the same way.
- The CFG-ESS-006 reason codes need a configuration item type in configuration.v1. Until they have one, the preview uses the specified defaults.
- When the shell SDK gets a service client, the api/http.ts copies in these folders move into it, as the earlier screen sessions recorded.