Class ConstraintPolicyOperations
java.lang.Object
co.ankatech.ankasecure.keymanagement.ConstraintPolicyOperations
The tenant's constraint policies: the usage, time and payload bounds a capability grant can carry.
Obtained from
AuthenticatedKeyManagementSdk.constraintPolicies().
ConstraintPolicyResponse policy = sdk.constraintPolicies().create(
new CreateConstraintPolicyRequest().name("nightly-batch").maxUsage(1000));
-
Method Summary
Modifier and TypeMethodDescriptioncompareVersions(UUID baseVersionId, UUID targetVersionId) Compares two versions of one policy (GET /tenants/{t}/constraint-policies/versions/compare): the fields whose value differs, each with its base and target value.create(CreateConstraintPolicyRequest request) Creates a constraint policy (POST /tenants/{t}/constraint-policies).voidDeletes a constraint policy (DELETE /tenants/{t}/constraint-policies/{p}).Reads one constraint policy (GET /tenants/{t}/constraint-policies/{p}).list(ConstraintPolicyListQuery query) Lists constraint policies (GET /tenants/{t}/constraint-policies).update(UUID policyId, CreateConstraintPolicyRequest request) Updates a constraint policy (PATCH /tenants/{t}/constraint-policies/{p}).Reads one version of a policy (GET /tenants/{t}/constraint-policies/{p}/versions/{v}).Lists every version of a policy, oldest first (GET /tenants/{t}/constraint-policies/{p}/versions).
-
Method Details
-
list
Lists constraint policies (GET /tenants/{t}/constraint-policies).- Parameters:
query- the page; must not benull- Returns:
- one page of policies
- Throws:
KeyManagementSdkException- when the call is refused
-
create
Creates a constraint policy (POST /tenants/{t}/constraint-policies).- Parameters:
request- the policy; must not benull- Returns:
- the created policy
- Throws:
KeyManagementSdkException- when the call is refused
-
get
Reads one constraint policy (GET /tenants/{t}/constraint-policies/{p}).- Parameters:
policyId- the policy; must not benull- Returns:
- the policy
- Throws:
KeyManagementSdkException- when the call is refused
-
update
Updates a constraint policy (PATCH /tenants/{t}/constraint-policies/{p}).- Parameters:
policyId- the policy; must not benullrequest- the policy's new values; must not benull- Returns:
- the updated policy
- Throws:
KeyManagementSdkException- when the call is refused
-
delete
Deletes a constraint policy (DELETE /tenants/{t}/constraint-policies/{p}).- Parameters:
policyId- the policy; must not benull- Throws:
KeyManagementSdkException- when a grant still carries the policy (409) or the call is refused
-
versions
Lists every version of a policy, oldest first (GET /tenants/{t}/constraint-policies/{p}/versions). Creating a policy writes version 1 and every edit writes the next one; a version never changes.- Parameters:
policyId- the policy; must not benull- Returns:
- the versions, each with how many live grants are pinned to it
- Throws:
KeyManagementSdkException- when the call is refused
-
version
Reads one version of a policy (GET /tenants/{t}/constraint-policies/{p}/versions/{v}).- Parameters:
policyId- the policy; must not benullversion- the version number- Returns:
- the limits and schedule a grant pinned to it enforces
- Throws:
KeyManagementSdkException- when the call is refused
-
compareVersions
Compares two versions of one policy (GET /tenants/{t}/constraint-policies/versions/compare): the fields whose value differs, each with its base and target value. Two versions of different policies are refused (400).- Parameters:
baseVersionId- the base version's id, asversions(UUID)returns it; must not benulltargetVersionId- the target version's id; must not benull- Returns:
- the changed fields
- Throws:
KeyManagementSdkException- when the call is refused
-