Create Access Policy
const url = 'https://example.com/vault/v1/workspaces/example/engines/qibdo/accessPolicies';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","document":{"rules":[{"resource_name_pattern":"example","permissions":["example"],"ttl_cap":"example","conditions":[{"source_ip":{"operator":"SOURCE_IP_OPERATOR_UNSPECIFIED","cidrs":["example"]},"time_window":{"operator":"TIME_WINDOW_OPERATOR_UNSPECIFIED","from":"example","to":"example","timezone":"example"}}]}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/vault/v1/workspaces/example/engines/qibdo/accessPolicies \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "document": { "rules": [ { "resource_name_pattern": "example", "permissions": [ "example" ], "ttl_cap": "example", "conditions": [ { "source_ip": { "operator": "SOURCE_IP_OPERATOR_UNSPECIFIED", "cidrs": [ "example" ] }, "time_window": { "operator": "TIME_WINDOW_OPERATOR_UNSPECIFIED", "from": "example", "to": "example", "timezone": "example" } } ] } ] } }'Creates a new access policy under a workspace. Name is unique within the workspace. Returns an operation describing the create.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The workspace to create the access policy in.
Query Parameters
Section titled “Query Parameters ”Optional weak reference to a topology Location where the access policy resides. Defaults to the global location when omitted; immutable after creation. Only the global location is available in this release.
Request Body required
Section titled “Request Body required ”QibdoAccessPolicy resource: workspace-scoped access policy document layered
on top of Qibdo IAM. The policy document composes one or more rules that
grant a set of permissions on a resource-name pattern, optionally constrained
by source IP ranges or time windows. The version_history list is a
Qibdo-invented enhancement: every update appends the previous document so the
full revision trail is auditable. Policies are consulted as a second-pass
check after the IAM @PreAuthorize gate.
object
The unique identifier of the access policy (UUID).
The workspace this policy belongs to (UUID, weak reference to taxonomy).
Human-readable name of the policy, unique within the workspace (3–256 chars, lowercase alphanumerics plus / - _).
The JSONB schema version governing the shape of document and
version_history entries. Server-managed.
The active policy document (rules + conditions).
object
The rules that make up this policy. Every rule’s resource_name_pattern MUST be unique within a document.
AccessPolicyRule: grants a set of permissions on a resource-name pattern, optionally bounded by TTL and conditions.
object
Resource-name pattern, e.g. “workspaces//secrets/”. The wildcard semantics follow Google AIP-159.
Permissions granted when the rule matches, e.g. “vault.secret.get”. At least one permission is required per rule.
Optional upper bound on the lifetime of credentials issued via this rule. Unset means no TTL cap imposed by this rule.
Conjunctive constraints; all listed conditions must evaluate to true for the rule to apply.
AccessPolicyCondition: a constraint evaluated at authorization time. Mirrors IAM’s Condition hierarchy structurally (DOM-003: no shared domain types across bounded contexts).
object
SourceIpCondition: restricts access to callers whose source IP falls inside (or outside) a set of CIDR ranges.
object
Whether the rule grants when the source IP is in any listed CIDR, or in none.
List of CIDR ranges to match against the caller’s source IP.
TimeWindowCondition: restricts access to callers whose request timestamp falls inside (or outside) a daily time window in the given timezone.
object
Whether the rule grants when the current time is inside [from, to], or outside it.
Start of the window in HH:mm 24-hour notation.
End of the window in HH:mm 24-hour notation.
IANA timezone identifier, e.g. “Europe/Amsterdam”.
Append-only list of previous document revisions. Each update pushes the pre-mutation document onto this list. Server-managed.
AccessPolicyRevision: a snapshot of a previous policy document captured at update time. Qibdo-invented audit trail (upstream clouds do not expose policy revision history).
object
Monotonically increasing revision number; starts at 1 for the first edit.
The document that was replaced.
object
The rules that make up this policy. Every rule’s resource_name_pattern MUST be unique within a document.
AccessPolicyRule: grants a set of permissions on a resource-name pattern, optionally bounded by TTL and conditions.
object
Resource-name pattern, e.g. “workspaces//secrets/”. The wildcard semantics follow Google AIP-159.
Permissions granted when the rule matches, e.g. “vault.secret.get”. At least one permission is required per rule.
Optional upper bound on the lifetime of credentials issued via this rule. Unset means no TTL cap imposed by this rule.
Conjunctive constraints; all listed conditions must evaluate to true for the rule to apply.
AccessPolicyCondition: a constraint evaluated at authorization time. Mirrors IAM’s Condition hierarchy structurally (DOM-003: no shared domain types across bounded contexts).
object
SourceIpCondition: restricts access to callers whose source IP falls inside (or outside) a set of CIDR ranges.
object
Whether the rule grants when the source IP is in any listed CIDR, or in none.
List of CIDR ranges to match against the caller’s source IP.
TimeWindowCondition: restricts access to callers whose request timestamp falls inside (or outside) a daily time window in the given timezone.
object
Whether the rule grants when the current time is inside [from, to], or outside it.
Start of the window in HH:mm 24-hour notation.
End of the window in HH:mm 24-hour notation.
IANA timezone identifier, e.g. “Europe/Amsterdam”.
The principal that performed the edit (UUID, weak reference to IAM user).
When the edit happened (server-managed).
Timestamp when the policy was created (server-managed).
Timestamp when the policy was last updated (server-managed).
Weak reference to a topology Location: where this resource resides. Defaults to the global location when omitted at creation and is immutable thereafter. Only the global location is available in this release.
Responses
Section titled “ Responses ”OK
Vault Operation
An acknowledgment of a mutation request, carrying tracking metadata, errors, and warnings. Follows GCP’s Operations pattern (AIP-151).
object
Operation ID
Unique identifier for this operation.
Resource ID
The ID of the resource affected by this operation. May be empty for vault-level lifecycle operations such as snapshot.
Resource Type
The type of resource (e.g., “com.qibdo.cloud.vault:secret”).
Operation Type
The kind of mutation that was requested.
Status
Current lifecycle state of the operation.
Insert Time
When the operation was first created.
Start Time
When the operation started executing.
End Time
When the operation completed (either successfully or with errors).
Errors
Business rule errors encountered during the operation.
Operation Error
A structured error returned inside an operation when a business rule fails.
object
Error Code
Numeric identifier following the S_SSS_EEE convention.
Description
Human-readable explanation of the error.
Reason
Machine-readable error identifier in UPPER_SNAKE form — the same dispatch
key google.rpc.ErrorInfo.reason carries on the synchronous error plane.
Warnings
Non-fatal notices about the operation.
Operation Warning
A non-fatal notice attached to an operation. The operation still completed; the warning surfaces unsupported features or capability gaps in the underlying engine.
object
Warning Code
Numeric identifier following the S_SSS_EEE convention.
Description
Human-readable explanation of the warning.
Progress
Percentage of completion (0-100).
Scope Type
The category of scope the operation ran in or was triggered from. VAULT_SCOPE_TYPE_UNSPECIFIED when the operation is not scoped.
Scope ID
The resource this operation was scoped to — for example, when scope_type is VAULT_SCOPE_TYPE_WORKSPACE this is the workspace id. Empty for VAULT_SCOPE_TYPE_PLATFORM, which has no scoped resource, and when unscoped.
Principal ID
Who performed or triggered the operation, whether a person or a machine account. Always populated: platform-driven work records the reserved system principal, so every audit record names an actor.
Trace ID
W3C trace id, for correlating this operation with the traces and log lines of the request that caused it. Empty when the operation ran with no trace context — a scheduled or event-driven action rather than a request.
Example
{ "operation_type": "VAULT_OPERATION_TYPE_UNSPECIFIED", "status": "VAULT_OPERATION_STATUS_UNSPECIFIED", "scope_type": "VAULT_SCOPE_TYPE_UNSPECIFIED"}default
Section titled “default ”Default error response
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
object
The type of the serialized message.
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}