Class QuorumRequestOperations

java.lang.Object
co.ankatech.ankasecure.keymanagement.QuorumRequestOperations

public final class QuorumRequestOperations extends Object
The workload's own quorum requests: the destruction requests and gated key changes it made. Obtained from AuthenticatedKeyManagementSdk.quorumRequests().

The Admin API shows a workload only the requests it made for key management operations; any other request answers 404 to it. A request is approved or rejected by people in the Admin Console; this SDK can read it and withdraw it while it waits, never decide it.


 QuorumRequestResponse request = sdk.quorumRequests().get(receipt.requestId());
 if ("PENDING".equals(request.getStatus())) {
     sdk.quorumRequests().cancel(UUID.fromString(receipt.requestId()));
 }
 
  • Method Details

    • list

      Lists the workload's quorum requests (GET /tenants/{t}/quorum/requests).
      Parameters:
      query - the filters and page; must not be null
      Returns:
      one page of requests
      Throws:
      KeyManagementSdkException - when the call is refused
    • get

      public QuorumRequestResponse get(UUID requestId)
      Reads one of the workload's quorum requests (GET /tenants/{t}/quorum/requests/{id}).
      Parameters:
      requestId - the request id; must not be null
      Returns:
      the request, with its status, approvals and decisions
      Throws:
      KeyManagementSdkException - when the request is not one of the workload's (404) or the call is refused
    • get

      public QuorumRequestResponse get(String requestId)
      Reads one of the workload's quorum requests by the id a QuorumRequestReceipt carries.
      Parameters:
      requestId - the request id, a UUID; must not be null
      Returns:
      the request
      Throws:
      IllegalArgumentException - when requestId is not a UUID
      KeyManagementSdkException - when the call is refused
    • cancel

      public QuorumRequestResponse cancel(UUID requestId)
      Withdraws one of the workload's waiting quorum requests (POST /tenants/{t}/quorum/requests/{id}/cancel). Only the requester can withdraw a request, and only while it waits.
      Parameters:
      requestId - the request id; must not be null
      Returns:
      the cancelled request
      Throws:
      KeyManagementSdkException - when the request has already been decided (409) or the call is refused