Class ServerControlStore
java.lang.Object
zeroecho.pki.server.ServerControlStore
- All Implemented Interfaces:
AutoCloseable
Dedicated durable authority for finite server security and disclosure control
metadata.
All public operations are synchronized to serialize compare-and-replace
within one realm process. Cross-process exclusion and durability remain the
responsibility of the composed TransactionalMetadataStore. No PKI
certificate, CRL, CSR, key, secret, or unrestricted exception data is stored.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFinite page returned without materializing the complete namespace.static final classThread-confined, closeable iterator over one immutable protocol snapshot.static final recordOne compare-and-set mutation participating in an atomic protocol-state change.static final recordStrict opaque protocol payload framed by the server-control authority.static final recordDurable realm-control identity and commitments. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStable namespace for ACME account records.static final StringStable namespace for ACME authorization records.static final StringStable namespace for ACME challenge records.static final StringStable namespace for ACME directory records.static final StringStable namespace for ACME validation-evidence records.static final StringStable namespace for ACME order records.static final StringStable namespace for approvals.static final StringStable namespace for scoped role assignments.static final StringStable namespace for the durable cross-store audit-log integrity anchor.static final StringStable namespace for per-family success-evidence audit-projection cursors.static final StringStable namespace for break-glass records.static final StringStable namespace for capability commitments.static final StringStable namespace for fixed CMP response slots owned by a manifest.static final StringStable namespace for quota-reserved CMP transaction manifests.static final StringStable namespace for disclosure records.static final StringStable namespace for immutable enrollment credential-set commitments.static final StringStable namespace for revisioned enrollment endpoint bindings and tombstones.static final StringImmutable server-keygen reservations and encrypted delivery lifecycle.static final StringStable namespace for durable enrollment policy profiles.static final StringStable namespace for durable enrollment transactions and replay tombstones.static final StringStable namespace for direct permission grants.static final StringStable namespace for durable OCSP responder bindings.static final StringStable namespace for principals.static final StringStable namespace for the realm record.static final StringStable namespace for non-authoritative public repository aliases.static final StringStable namespace for non-authoritative revocation-audit projection state. -
Constructor Summary
ConstructorsConstructorDescriptionServerControlStore(TransactionalMetadataStore metadata) Creates a server-control adapter over one exclusively owned metadata store. -
Method Summary
Modifier and TypeMethodDescriptionapprovals(int offset, int limit) Returns a bounded stable page of approval records.assignments(int offset, int limit) Returns a bounded stable page of role assignments.assignmentsFor(String principalId) Lists assignments for one principal from one stable metadata snapshot.breakGlass(int offset, int limit) Returns a bounded stable page of break-glass records.breakGlassFor(String principalId) Lists break-glass records for one principal.capabilitiesFor(PkiId objectId) Lists capability commitments bound to one object.voidclose()Opens no sidecar authority and closes the sole metadata authority idempotently.voidCreates one approval request.voidCreates one scoped role assignment.voidCreates one break-glass record.voidCreates one commitment-only capability record.voidCreates one disclosure record.voidcreateGrant(Permission.Grant value) Creates one direct grant.voidcreatePrincipal(SecurityPrincipal value) Creates one principal.voidCreates one exact repository alias record.disclosures(int offset, int limit) Returns a bounded stable page of disclosure records.ensureRealm(ServerControlStore.RealmRecord expected) Creates or validates the sole realm identity record.findDisclosure(PkiId objectId) Finds one disclosure record without converting absence into an error.findRepositoryAlias(String aliasId) Finds one exact repository alias record.grants(int offset, int limit) Returns a bounded stable page of direct grants.Lists direct grants for one principal from one stable snapshot.id()Returns the durable server-control metadata-store identity.voidmutateProtocol(List<ServerControlStore.ProtocolMutation> requested) Atomically creates or compare-and-replaces a finite set of protocol records.longCounts pending, unexpired approvals in one stable metadata scan using constant auxiliary memory.principals(int offset, int limit) Returns a bounded stable page of principals in metadata-key order.protocolRecord(String namespace, String recordId) Reads one exact protocol record from its closed namespace.protocolRecords(String namespace, int offset, int limit) Returns one bounded deterministic page of protocol records.protocolSnapshot(String namespace) Opens a single consistent protocol snapshot for linear-time startup accounting.voidreplaceApproval(ApprovalService.Request current, ApprovalService.Request updated) Replaces one approval request through compare-and-replace.voidreplaceAssignment(RoleTemplateCatalog.Assignment current, RoleTemplateCatalog.Assignment updated) Replaces one exact role assignment.voidreplaceBreakGlass(BreakGlassService.Record current, BreakGlassService.Record updated) Replaces one break-glass record.voidreplaceCapability(DisclosureService.Capability current, DisclosureService.Capability updated) Replaces one capability record.voidreplaceDisclosure(DisclosureService.Record current, DisclosureService.Record updated) Replaces one disclosure record.voidreplaceGrant(Permission.Grant current, Permission.Grant updated) Replaces one direct grant.voidreplacePrincipal(SecurityPrincipal current, SecurityPrincipal updated) Replaces one exact principal.voidreplaceRepositoryAlias(RepositoryAliasService.Record current, RepositoryAliasService.Record updated, Optional<String> expectedCurrentCommitment) Atomically replaces an alias after exact expected-current validation.repositoryAliases(int offset, int limit) Returns a bounded repository alias page.requireApproval(String approvalId) Returns one approval request.requireAssignment(String assignmentId) Returns one role assignment.requireBreakGlass(String breakGlassId) Returns one break-glass record.requireCapability(String capabilityId) Returns one capability record.requireDisclosure(PkiId objectId) Returns one disclosure record.requireGrant(String grantId) Returns one direct grant.requirePrincipal(String principalId) Returns one principal or fails without revealing storage details.requireRepositoryAlias(String aliasId) Returns one exact repository alias record.selectCapabilities(PkiId objectId, Optional<String> after, int limit, CancellationSignal cancellation) Selects capabilities for one already-authorized object in ascending capability-ID order.voidStrictly decodes and cross-checks every authoritative control record from stable metadata snapshots before the realm is exposed.voidValidates durable relationships against the active strict role catalog.
-
Field Details
-
REALM
-
PRINCIPAL
-
ASSIGNMENT
-
GRANT
-
APPROVAL
-
BREAK_GLASS
-
DISCLOSURE
-
CAPABILITY
-
REPOSITORY_ALIAS
Stable namespace for non-authoritative public repository aliases.- See Also:
-
ACME_DIRECTORY
-
ACME_ACCOUNT
-
ACME_ORDER
-
ACME_AUTHORIZATION
Stable namespace for ACME authorization records.- See Also:
-
ACME_CHALLENGE
-
ACME_EVIDENCE
Stable namespace for ACME validation-evidence records.- See Also:
-
OCSP_RESPONDER
Stable namespace for durable OCSP responder bindings.- See Also:
-
ENROLLMENT_PROFILE
Stable namespace for durable enrollment policy profiles.- See Also:
-
ENROLLMENT_ENDPOINT
Stable namespace for revisioned enrollment endpoint bindings and tombstones.- See Also:
-
ENROLLMENT_CREDENTIAL
Stable namespace for immutable enrollment credential-set commitments.- See Also:
-
ENROLLMENT_REQUEST
Stable namespace for durable enrollment transactions and replay tombstones.- See Also:
-
CMP_TRANSACTION
Stable namespace for quota-reserved CMP transaction manifests.- See Also:
-
CMP_RESPONSE
Stable namespace for fixed CMP response slots owned by a manifest.- See Also:
-
ENROLLMENT_KEYGEN
Immutable server-keygen reservations and encrypted delivery lifecycle.- See Also:
-
REVOCATION_AUDIT_PROJECTION
Stable namespace for non-authoritative revocation-audit projection state.- See Also:
-
AUDIT_ANCHOR
Stable namespace for the durable cross-store audit-log integrity anchor.- See Also:
-
AUDIT_EVIDENCE_PROJECTION
Stable namespace for per-family success-evidence audit-projection cursors.- See Also:
-
-
Constructor Details
-
ServerControlStore
Creates a server-control adapter over one exclusively owned metadata store.- Parameters:
metadata- lifecycle-owned metadata authority
-
-
Method Details
-
id
Returns the durable server-control metadata-store identity.- Returns:
- durable metadata-store identity
- Throws:
IllegalStateException- if this adapter is closed
-
ensureRealm
Creates or validates the sole realm identity record.- Parameters:
expected- expected immutable realm record- Returns:
- existing or newly created exact realm record
-
createPrincipal
Creates one principal.- Parameters:
value- validated record to create
-
replacePrincipal
Replaces one exact principal.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
requirePrincipal
Returns one principal or fails without revealing storage details.- Parameters:
principalId- stable principal identifier- Returns:
- exact principal
-
principals
Returns a bounded stable page of principals in metadata-key order.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded principal page
-
createAssignment
Creates one scoped role assignment.- Parameters:
value- validated record to create
-
requireAssignment
Returns one role assignment.- Parameters:
assignmentId- stable role-assignment identifier- Returns:
- exact role assignment
-
replaceAssignment
public void replaceAssignment(RoleTemplateCatalog.Assignment current, RoleTemplateCatalog.Assignment updated) Replaces one exact role assignment.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
assignments
Returns a bounded stable page of role assignments.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded role-assignment page
-
assignmentsFor
Lists assignments for one principal from one stable metadata snapshot.- Parameters:
principalId- stable principal identifier- Returns:
- immutable assignments for the principal
-
createGrant
Creates one direct grant.- Parameters:
value- validated record to create
-
requireGrant
Returns one direct grant.- Parameters:
grantId- stable grant identifier- Returns:
- exact permission grant
-
grants
Returns a bounded stable page of direct grants.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded grant page
-
replaceGrant
Replaces one direct grant.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
grantsFor
Lists direct grants for one principal from one stable snapshot.- Parameters:
principalId- stable principal identifier- Returns:
- immutable direct grants for the principal
-
createApproval
Creates one approval request.- Parameters:
value- validated record to create
-
replaceApproval
Replaces one approval request through compare-and-replace.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
requireApproval
Returns one approval request.- Parameters:
approvalId- stable approval identifier- Returns:
- exact approval request
-
approvals
Returns a bounded stable page of approval records.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded approval page
-
pendingApprovalCount
Counts pending, unexpired approvals in one stable metadata scan using constant auxiliary memory.- Parameters:
now- evaluation instant- Returns:
- exact count in this snapshot
-
createBreakGlass
Creates one break-glass record.- Parameters:
value- validated record to create
-
replaceBreakGlass
Replaces one break-glass record.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
requireBreakGlass
Returns one break-glass record.- Parameters:
breakGlassId- stable break-glass identifier- Returns:
- exact break-glass record
-
breakGlassFor
Lists break-glass records for one principal.- Parameters:
principalId- stable principal identifier- Returns:
- immutable break-glass records for the principal
-
breakGlass
Returns a bounded stable page of break-glass records.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded break-glass page
-
createDisclosure
Creates one disclosure record.- Parameters:
value- validated record to create
-
replaceDisclosure
Replaces one disclosure record.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
requireDisclosure
Returns one disclosure record.- Parameters:
objectId- exact protected object identifier- Returns:
- exact disclosure record
-
findDisclosure
Finds one disclosure record without converting absence into an error.- Parameters:
objectId- exact protected object identifier- Returns:
- matching record or empty
-
disclosures
Returns a bounded stable page of disclosure records.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded disclosure page
-
createCapability
Creates one commitment-only capability record.- Parameters:
value- validated record to create
-
replaceCapability
public void replaceCapability(DisclosureService.Capability current, DisclosureService.Capability updated) Replaces one capability record.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identity
-
requireCapability
Returns one capability record.- Parameters:
capabilityId- stable capability identifier- Returns:
- exact capability metadata
-
protocolRecord
public Optional<ServerControlStore.ProtocolRecord> protocolRecord(String namespace, String recordId) Reads one exact protocol record from its closed namespace.- Parameters:
namespace- closed protocol namespacerecordId- canonical protocol record identifier- Returns:
- matching protocol record or empty
-
protocolRecords
public ServerControlStore.Page<ServerControlStore.ProtocolRecord> protocolRecords(String namespace, int offset, int limit) Returns one bounded deterministic page of protocol records.- Parameters:
namespace- closed protocol namespaceoffset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded protocol-record page
-
protocolSnapshot
Opens a single consistent protocol snapshot for linear-time startup accounting. The caller must close the thread-confined cursor before closing this store. Traversal and caller processing occur outside the control monitor. Each step retains one bounded record; the metadata provider owns snapshot resources.- Parameters:
namespace- closed protocol namespace- Returns:
- caller-owned snapshot cursor
-
mutateProtocol
Atomically creates or compare-and-replaces a finite set of protocol records. Empty expected commitments mean create-only; present commitments mean exact compare-and-replace. Provider I/O and PKI operations must occur outside this method.- Parameters:
requested- finite nonempty atomic mutation set
-
selectCapabilities
public List<DisclosureService.Capability> selectCapabilities(PkiId objectId, Optional<String> after, int limit, CancellationSignal cancellation) Selects capabilities for one already-authorized object in ascending capability-ID order. The namespace is scanned once; O(N log L) comparisons and O(L) retained rows, plus decoded record I/O.- Parameters:
objectId- exact object whose disclosure-read scope the gateway authorizedafter- exclusive capability identifierlimit- maximum rows, 1 through 1001 including lookaheadcancellation- cooperative cancellation checked for each record- Returns:
- immutable bounded page; no global count or namespace cursor
-
capabilitiesFor
Lists capability commitments bound to one object.- Parameters:
objectId- exact protected object identifier- Returns:
- immutable capability metadata for the object
-
createRepositoryAlias
Creates one exact repository alias record.- Parameters:
value- validated record to create
-
findRepositoryAlias
Finds one exact repository alias record.- Parameters:
aliasId- stable repository-alias identifier- Returns:
- matching alias or empty
-
requireRepositoryAlias
Returns one exact repository alias record.- Parameters:
aliasId- stable repository-alias identifier- Returns:
- exact alias record
-
replaceRepositoryAlias
public void replaceRepositoryAlias(RepositoryAliasService.Record current, RepositoryAliasService.Record updated, Optional<String> expectedCurrentCommitment) Atomically replaces an alias after exact expected-current validation.- Parameters:
current- caller-observed current recordupdated- replacement record with the same identityexpectedCurrentCommitment- optional expected current record commitment
-
repositoryAliases
public ServerControlStore.Page<RepositoryAliasService.Record> repositoryAliases(int offset, int limit) Returns a bounded repository alias page.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- bounded repository-alias page
-
validateAll
public void validateAll()Strictly decodes and cross-checks every authoritative control record from stable metadata snapshots before the realm is exposed. -
validateReferences
Validates durable relationships against the active strict role catalog.- Parameters:
roles- active strict role-template catalog
-
close
Opens no sidecar authority and closes the sole metadata authority idempotently.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-