Resource: TransactionPolicy
An immutable Cedar policy rule that governs whether transactions in an instance are permitted or denied before signing.
Every completed activation or disable transition receives a monotonically increasing sequence number within the instance, recorded once in activationInfo.transition_sequence or deactivationInfo.transition_sequence. This value is the policy set version produced by the transition.
Withdrawing a policy that is still waiting for activation assigns no sequence number and does not advance the policy set version.
| JSON representation |
|---|
{ "name": string, "uid": string, "displayName": string, "rule": { object ( |
| Fields | |
|---|---|
name |
Identifier. The resource name of the TransactionPolicy. Format: projects/{project}/locations/{location}/instances/{instance}/transactionPolicies/{transactionPolicy} |
uid |
Output only. The unique server-generated identifier of the TransactionPolicy. |
displayName |
Optional. Immutable. User-assigned display name for the TransactionPolicy. Maximum length is 63 characters. Set at creation; TransactionPolicy resources are immutable and have no update method. |
rule |
Required. Immutable. The policy rule evaluated against transactions. To change a rule, disable this policy with transactionPolicies.disable and create a new policy with transactionPolicies.create. |
state |
Output only. The lifecycle state of the TransactionPolicy. |
activationInfo |
Output only. The approval status and Policy Author approvals collected to activate this policy. |
deactivationInfo |
Output only. The approval status and Policy Author approvals collected to disable this policy. Unset until transactionPolicies.disable is called. |
createTime |
Output only. The time at which the TransactionPolicy was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
updateTime |
Output only. The time at which the TransactionPolicy was last updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Rule
The policy rule evaluated for a TransactionPolicy.
| JSON representation |
|---|
{ // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "cedarDocument": string // End of mutually exclusive fields. } |
| Fields | |
|---|---|
| The rule definition for this TransactionPolicy. Must be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
cedarDocument |
Optional. A single non-empty Cedar policy statement. Must be valid Cedar syntax; invalid or empty statements are rejected with INVALID_ARGUMENT. |
| End of mutually exclusive fields. | |
State
The lifecycle state of a TransactionPolicy.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
Default value. This value is unused. |
PENDING_ACTIVE |
The policy has been proposed and is waiting for the required number of Policy Author approvals before it becomes active. The policy is not yet enforced on transactions and can be withdrawn by calling transactionPolicies.disable. |
ACTIVE |
The policy is active and enforced on transactions. |
PENDING_DISABLED |
A request to disable the policy is waiting for the required number of Policy Author approvals. The policy remains in effect and is still enforced on transactions until those approvals are recorded. |
DISABLED |
The policy is permanently disabled and is no longer enforced on new transactions, or was withdrawn before it ever became active. Disabled policies are kept for auditing. |
ApprovalInfo
Tracks the Policy Author approvals for activating or disabling a TransactionPolicy.
To build an AuthorizationInfo for a policy transition, serialize a TransactionPolicySigningPayload into signedPayload and sign those bytes in signature using the private key for the Policy Author's registered User.authorization_key.
The service verifies signature over the exact signedPayload bytes as received, then unmarshals signedPayload as a TransactionPolicySigningPayload and returns INVALID_ARGUMENT if it cannot be unmarshaled or if any field does not match the transition being authorized.
| JSON representation |
|---|
{
"approvals": [
{
object ( |
| Fields | |
|---|---|
approvals[] |
Output only. The Policy Author approvals collected for this transition. The first entry is the approval of the Policy Author who initiated the request. Additional entries are appended as other Policy Authors call transactionPolicies.approve. |
transitionSequence |
Output only. The positive sequence number assigned when the required number of Policy Author approvals was reached and the transition completed. This value is the policy set version produced by this transition. Unset when either the transition is still waiting for approvals or the policy was withdrawn. |
requiredApprovalCount |
Output only. The number of Policy Author approvals required to complete this transition. While the transition is waiting for approvals, this reflects the instance's current threshold and may change if the threshold is updated. Once the transition completes, it is fixed to the threshold in effect when it completed. |
Approval
A Policy Author's recorded approval on a policy transition.
| JSON representation |
|---|
{
"user": string,
"authorizationInfo": {
object ( |
| Fields | |
|---|---|
user |
Output only. The resource name of the User who provided this approval, resolved from the caller's authenticated identity. Format: projects/{project}/locations/{location}/instances/{instance}/users/{user} |
authorizationInfo |
Output only. The cryptographic authorization provided by the Policy Author. |
approveTime |
Output only. The time at which the approval was recorded. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Methods |
|
|---|---|
|
Records a Policy Author's approval for a policy that is waiting to be activated or disabled. |
|
Proposes a new TransactionPolicy in an instance. |
|
Starts disabling a policy, or withdraws a policy that is still waiting for activation. |
|
Gets details of a single TransactionPolicy, including its Cedar rule, current lifecycle state, and recorded Policy Author approvals. |
|
Lists TransactionPolicy resources in an instance, including disabled policies. |