Class ApprovalService
java.lang.Object
zeroecho.pki.server.ApprovalService
Durable exact-operation multi-party approval service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndividual immutable approval choice.static final recordOne attributable immutable decision.static final recordImmutable approval policy.static final recordDurable approval authority record.static enumApproval lifecycle states. -
Constructor Summary
ConstructorsConstructorDescriptionApprovalService(ServerControlStore store, Clock clock, AuditSink auditSink) Creates a durable approval service over one server-control authority. -
Method Summary
Modifier and TypeMethodDescriptionCancels a pending request by its requester.claim(String approvalId, String operationId, String operationCommitment, Permission.Scope scope) Validates and durably claims an approved operation before dispatch.Durably links the safe result of one claimed execution.decide(String approvalId, String principalId, ApprovalService.Choice choice, String justification) Records one distinct qualified decision and advances the durable state.static StringComputes a deterministic SHA-256 hexadecimal commitment.request(String approvalId, String operationId, String operationCommitment, Permission.Scope scope, String requesterPrincipalId, ApprovalService.Policy policy) Creates a new pending exact-operation request.requireCurrent(String approvalId) Returns the current record, applying durable expiry when necessary.
-
Constructor Details
-
ApprovalService
Creates a durable approval service over one server-control authority.- Parameters:
store- durable server-control storeclock- authoritative server clockauditSink- required safe audit sink
-
-
Method Details
-
request
public ApprovalService.Request request(String approvalId, String operationId, String operationCommitment, Permission.Scope scope, String requesterPrincipalId, ApprovalService.Policy policy) Creates a new pending exact-operation request.- Parameters:
approvalId- stable approval identifieroperationId- stable typed operation identifieroperationCommitment- exact safe operation commitmentscope- exact security scoperequesterPrincipalId- requesting principal identifierpolicy- frozen approval policy- Returns:
- new durable pending approval request
-
decide
public ApprovalService.Request decide(String approvalId, String principalId, ApprovalService.Choice choice, String justification) Records one distinct qualified decision and advances the durable state.- Parameters:
approvalId- stable approval identifierprincipalId- deciding principal identifierchoice- approval or rejectionjustification- bounded operator justification- Returns:
- durably updated approval request
-
cancel
Cancels a pending request by its requester.- Parameters:
approvalId- stable approval identifierrequesterPrincipalId- requesting principal identifier- Returns:
- durably cancelled request
-
claim
public ApprovalService.Request claim(String approvalId, String operationId, String operationCommitment, Permission.Scope scope) Validates and durably claims an approved operation before dispatch.- Parameters:
approvalId- stable approval identifieroperationId- stable typed operation identifieroperationCommitment- exact safe operation commitmentscope- exact security scope- Returns:
- durably claimed executing request
-
complete
Durably links the safe result of one claimed execution.- Parameters:
approvalId- stable approval identifiersafeResultClassification- safe linked execution result- Returns:
- durably executed request
-
requireCurrent
Returns the current record, applying durable expiry when necessary.- Parameters:
approvalId- stable approval identifier- Returns:
- current request after applying expiry
-
digest
-