Class BreakGlassService
java.lang.Object
zeroecho.pki.server.BreakGlassService
Durable, scoped, mandatory-expiry emergency authorization service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordActive grants plus their identities for authorization and use auditing.static final recordDurable break-glass record.static enumBreak-glass lifecycle states. -
Constructor Summary
ConstructorsConstructorDescriptionBreakGlassService(ServerControlStore store, Clock clock, AuditSink auditSink) Creates a durable break-glass service. -
Method Summary
Modifier and TypeMethodDescriptionactivatePending(String breakGlassId, String actorPrincipalId, Optional<String> approvalId) Activates one independently approved pending emergency grant.Returns current active grants for one principal and enforces expiry after reopen.voidRecords use without exposing grant internals or reason.create(String breakGlassId, String principalId, Permission.Grant grant, String reason, String issuerPrincipalId, Optional<String> approvalId, Instant expiresAt) Creates one durable pending emergency grant without activating it.requireCurrent(String breakGlassId) Returns a current record, durably applying expiry when observed.Revokes an active grant.
-
Constructor Details
-
BreakGlassService
Creates a durable break-glass service.- Parameters:
store- durable server-control storeclock- authoritative server clockauditSink- required safe audit sink
-
-
Method Details
-
create
public BreakGlassService.Record create(String breakGlassId, String principalId, Permission.Grant grant, String reason, String issuerPrincipalId, Optional<String> approvalId, Instant expiresAt) Creates one durable pending emergency grant without activating it.- Parameters:
breakGlassId- stable emergency grant identifierprincipalId- grantee principal identifiergrant- exact scoped allow grantreason- mandatory bounded emergency reasonissuerPrincipalId- independent issuer principalapprovalId- independent execution approvalexpiresAt- mandatory expiry no more than 24 hours after activation- Returns:
- durable pending emergency grant
-
activatePending
public BreakGlassService.Record activatePending(String breakGlassId, String actorPrincipalId, Optional<String> approvalId) Activates one independently approved pending emergency grant.- Parameters:
breakGlassId- stable emergency grant identifieractorPrincipalId- authenticated administrative actorapprovalId- independent execution approval- Returns:
- durably active emergency grant
-
revoke
Revokes an active grant.- Parameters:
breakGlassId- stable emergency grant identifieractorPrincipalId- authenticated administrative actor- Returns:
- durably revoked emergency grant
-
requireCurrent
Returns a current record, durably applying expiry when observed.- Parameters:
breakGlassId- stable emergency grant identifier- Returns:
- current record after applying expiry
-
activeFor
Returns current active grants for one principal and enforces expiry after reopen.- Parameters:
principalId- grantee principal identifier- Returns:
- current unexpired active grants
-
auditUse
Records use without exposing grant internals or reason.- Parameters:
principalId- grantee principal identifier
-