Class BreakGlassService

java.lang.Object
zeroecho.pki.server.BreakGlassService

public final class BreakGlassService extends Object
Durable, scoped, mandatory-expiry emergency authorization service.
  • Constructor Details

    • BreakGlassService

      public BreakGlassService(ServerControlStore store, Clock clock, AuditSink auditSink)
      Creates a durable break-glass service.
      Parameters:
      store - durable server-control store
      clock - authoritative server clock
      auditSink - 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 identifier
      principalId - grantee principal identifier
      grant - exact scoped allow grant
      reason - mandatory bounded emergency reason
      issuerPrincipalId - independent issuer principal
      approvalId - independent execution approval
      expiresAt - 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 identifier
      actorPrincipalId - authenticated administrative actor
      approvalId - independent execution approval
      Returns:
      durably active emergency grant
    • revoke

      public BreakGlassService.Record revoke(String breakGlassId, String actorPrincipalId)
      Revokes an active grant.
      Parameters:
      breakGlassId - stable emergency grant identifier
      actorPrincipalId - authenticated administrative actor
      Returns:
      durably revoked emergency grant
    • requireCurrent

      public BreakGlassService.Record requireCurrent(String breakGlassId)
      Returns a current record, durably applying expiry when observed.
      Parameters:
      breakGlassId - stable emergency grant identifier
      Returns:
      current record after applying expiry
    • activeFor

      public BreakGlassService.ActiveGrants activeFor(String principalId)
      Returns current active grants for one principal and enforces expiry after reopen.
      Parameters:
      principalId - grantee principal identifier
      Returns:
      current unexpired active grants
    • auditUse

      public void auditUse(String principalId)
      Records use without exposing grant internals or reason.
      Parameters:
      principalId - grantee principal identifier