Services
RPC methods exposed by this API.PolicyService
| Method | Request | Response | Description |
|---|---|---|---|
| GetPolicy | GetPolicyRequest | GetPolicyResponse | Retrieve a policy |
| ListPolicies | ListPoliciesRequest | ListPoliciesResponse | Retrieve policies using an optional filter. |
| CreatePolicy | CreatePolicyRequest | CreatePolicyResponse | Create a policy |
| UpdatePolicy | UpdatePolicyRequest | UpdatePolicyResponse | Update a policy |
| ValidatePolicy | ValidatePolicyRequest | ValidatePolicyResponse | Validate a Cedar policy configuration |
| ArchivePolicy | ArchivePolicyRequest | ArchivePolicyResponse | Archive a policy |
| UnarchivePolicy | UnarchivePolicyRequest | UnarchivePolicyResponse | Unarchive a policy |
Messages
Data models used across requests/responses.ArchivePolicyRequest
The request for a call toPolicyService_ArchivePolicy to archive a policy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy_id | string |
ArchivePolicyResponse
The response of a call toPolicyService_ArchivePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy |
CreatePolicyRequest
The request for a call toPolicyService_CreatePolicy to create a new policy.
| Field | Type | Label | Description |
|---|---|---|---|
| name | string | ||
| description | string | optional | |
| configuration | PolicyConfiguration | Policy rules/configuration | |
| version_notes | string | optional | Optional notes for this version |
CreatePolicyResponse
The response of a call toPolicyService_CreatePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy |
GetPolicyRequest
The request for a call toPolicyService_GetPolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy_id | string |
GetPolicyResponse
The response of a call toPolicyService_GetPolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy |
ListPoliciesRequest
The request for a call toPolicyService_ListPolicies to retrieve policies.
| Field | Type | Label | Description |
|---|---|---|---|
| page_size | uint32 | The maximum number of policies to return. The service may return fewer than this value. If unspecified, at most 50 policies will be returned. The maximum value is 100; values above 100 will be coerced to 100. Optional. | |
| page_token | string | A page token, received from a previous ListPolicies call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPolicies must match the call that provided the page token. Optional. | |
| filter | string | A Common Expression Language (CEL) filter string. Available fields to filter by are policy_id, organization_id, name, description, created_by_user_id, modified_by_user_id, created_date, and modified_date. Archive state is controlled via the include_archived field below, not via filter. For further information about how to use CELs, please refer to this guide. For more information about the fields used for filtering, please refer to this definition. Optional. | |
| order_by | string | How to order the retrieved policies. Formatted as a comma-separated string i.e. “FIELD_NAME[ desc],…”. Available fields to order_by are created_date, modified_date, and name. If left empty, items are ordered by created_date in descending order (newest-first). For more information about the format of this field, read this Example: “created_date desc,modified_date” | |
| include_archived | bool | Whether to include archived policies in the response. If false or unset, archived policies are excluded. |
ListPoliciesResponse
The result of a call toPolicyService_ListPolicies.
| Field | Type | Label | Description |
|---|---|---|---|
| policies | Policy | repeated | |
| next_page_token | string |
Policy
| Field | Type | Label | Description |
|---|---|---|---|
| policy_id | string | ||
| name | string | ||
| description | string | optional | |
| organization_id | string | ||
| created_by_user_id | string | ||
| modified_by_user_id | string | ||
| created_date | google.protobuf.Timestamp | ||
| modified_date | google.protobuf.Timestamp | ||
| configuration | PolicyConfiguration | Policy rules/configuration | |
| policy_version_id | string | Reference to the current policy version ID | |
| archived_date | google.protobuf.Timestamp | The date the policy was archived. | |
| is_archived | bool | ||
| version | int32 | optional | Optional version number for this policy |
| version_notes | string | optional | Optional notes for this version |
| generated_change_message | string | optional | Auto-generated change message for this version |
PolicyConfiguration
PolicyConfiguration represents the configuration and rules for a policy. Expects a string containing a policy in the Cedar format https://docs.cedarpolicy.com/policies/syntax-policy.html| Field | Type | Label | Description |
|---|---|---|---|
| cedar_policy | string |
UnarchivePolicyRequest
The request for a call toPolicyService_UnarchivePolicy to unarchive a previously-archived policy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy_id | string |
UnarchivePolicyResponse
The response of a call toPolicyService_UnarchivePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy |
UpdatePolicyRequest
The request for a call toPolicyService_UpdatePolicy to update a policy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy | ||
| update_mask | google.protobuf.FieldMask | The list of fields to be updated. The fields available to be updated are name, description, configuration, and is_archived. | |
| version_notes | string | optional | Optional notes for the new policy version when configuration changes |
UpdatePolicyResponse
The response of a call toPolicyService_UpdatePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| policy | Policy |
ValidatePolicyRequest
The request for a call toPolicyService_ValidatePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| cedar_policy | string |
ValidatePolicyResponse
The response of a call toPolicyService_ValidatePolicy.
| Field | Type | Label | Description |
|---|---|---|---|
| valid | bool | ||
| failure_message | string | optional |