Documentation
¶
Overview ¶
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Package v1alpha1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type AlreadyExists
- type BadRequest
- type CreatePolicyJSONRequestBody
- type CreatePolicyParams
- type Error
- type ErrorType
- type Forbidden
- type Health
- type InternalServerError
- type ListPoliciesParams
- type NotFound
- type Policy
- type PolicyIdPath
- type PolicyList
- type PolicyPolicyType
- type Unauthorized
- type UpdatePolicyApplicationMergePatchPlusJSONRequestBody
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
Types ¶
type AlreadyExists ¶
type AlreadyExists = Error
AlreadyExists Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type BadRequest ¶
type BadRequest = Error
BadRequest Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type CreatePolicyJSONRequestBody ¶
type CreatePolicyJSONRequestBody = Policy
CreatePolicyJSONRequestBody defines body for CreatePolicy for application/json ContentType.
type CreatePolicyParams ¶
type CreatePolicyParams struct {
// Id Optional client-specified ID for the policy. If not provided, the
// server will generate a UUID.
//
// Requirements (per AEP-122):
// - 1-63 characters long
// - Start with lowercase letter
// - Contain only lowercase letters, numbers, and hyphens
// - End with letter or number
Id *string `form:"id,omitempty" json:"id,omitempty"`
}
CreatePolicyParams defines parameters for CreatePolicy.
type Error ¶
type Error struct {
// Detail Human-readable explanation specific to this occurrence of the problem.
// Should provide actionable information for developers.
Detail *string `json:"detail,omitempty"`
// Instance Unique identifier for this specific error occurrence. Useful for
// tracking and debugging.
Instance *string `json:"instance,omitempty"`
// Status HTTP status code
Status int32 `json:"status"`
// Title Human-readable summary of the problem type
Title string `json:"title"`
// Type URI reference identifying the problem type. This is the canonical
// error code.
Type ErrorType `json:"type"`
}
Error Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type ErrorType ¶
type ErrorType string
ErrorType URI reference identifying the problem type. This is the canonical error code.
const ( ABORTED ErrorType = "ABORTED" ALREADYEXISTS ErrorType = "ALREADY_EXISTS" DEADLINEEXCEEDED ErrorType = "DEADLINE_EXCEEDED" FAILEDPRECONDITION ErrorType = "FAILED_PRECONDITION" INTERNAL ErrorType = "INTERNAL" INVALIDARGUMENT ErrorType = "INVALID_ARGUMENT" NOTFOUND ErrorType = "NOT_FOUND" OUTOFRANGE ErrorType = "OUT_OF_RANGE" PERMISSIONDENIED ErrorType = "PERMISSION_DENIED" RESOURCEEXHAUSTED ErrorType = "RESOURCE_EXHAUSTED" UNAUTHENTICATED ErrorType = "UNAUTHENTICATED" UNAVAILABLE ErrorType = "UNAVAILABLE" UNIMPLEMENTED ErrorType = "UNIMPLEMENTED" )
Defines values for ErrorType.
type Forbidden ¶
type Forbidden = Error
Forbidden Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type Health ¶
type Health struct {
// Path Canonical path of the resource
Path *string `json:"path,omitempty"`
// Status Health status
Status string `json:"status"`
}
Health defines model for Health.
type InternalServerError ¶
type InternalServerError = Error
InternalServerError Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type ListPoliciesParams ¶
type ListPoliciesParams struct {
// PageToken Token for retrieving the next page of results. Leave empty for
// the first page. Use the `next_page_token` from the previous
// response to get the next page.
PageToken *string `form:"page_token,omitempty" json:"page_token,omitempty"`
// MaxPageSize Maximum number of policies to return per page. Server may return
// fewer results. If unspecified, defaults to 50. Maximum value is 1000.
MaxPageSize *int32 `form:"max_page_size,omitempty" json:"max_page_size,omitempty"`
// Filter Filter expression to apply to the list. Supports filtering by:
// - `policy_type`: GLOBAL or USER
// - `enabled`: true or false
//
// Examples:
// - `policy_type='GLOBAL'`
// - `enabled=true`
// - `policy_type='GLOBAL' AND enabled=true`
Filter *string `form:"filter,omitempty" json:"filter,omitempty"`
// OrderBy Comma-separated list of fields to order by. Each field can be
// followed by 'asc' or 'desc'. Defaults to 'priority asc'.
//
// Supported fields:
// - priority
// - display_name
// - create_time
//
// Examples:
// - `priority asc`
// - `display_name desc`
// - `create_time desc,priority asc`
OrderBy *string `form:"order_by,omitempty" json:"order_by,omitempty"`
}
ListPoliciesParams defines parameters for ListPolicies.
type NotFound ¶
type NotFound = Error
NotFound Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type Policy ¶
type Policy struct {
// CreateTime Timestamp when the policy was created. This field is output-only
// and automatically set by the server.
//
// Uses ISO 8601 format with timezone per AEP-140.
CreateTime *time.Time `json:"create_time,omitempty"`
// Description Optional detailed description of the policy's purpose and behavior.
// Supports markdown formatting.
Description *string `json:"description,omitempty"`
// DisplayName Human-readable name for the policy. This is typically shown in
// user interfaces and should be descriptive.
DisplayName *string `json:"display_name,omitempty"`
// Enabled Whether the policy is currently active. Disabled policies are not
// evaluated during authorization decisions.
Enabled *bool `json:"enabled,omitempty"`
// Id Unique identifier for the policy. This field is output-only and
// immutable after creation. The ID can be optionally specified via
// query parameter on creation; if not provided, the server generates a UUID.
//
// Follows AEP-122 resource ID conventions.
Id *string `json:"id,omitempty"`
// LabelSelector Key-value pairs used to match this policy against incoming requests.
// The policy is evaluated only if all labels match the request context.
// If no label selector is provided, the policy is evaluated for all requests.
//
// Common label keys:
// - environment: production, staging, development
// - user_id: user identifier
// - service: service name
// - region: geographical region
// - tier: service tier (critical, standard, etc.)
LabelSelector *map[string]string `json:"label_selector,omitempty"`
// Path Resource path in the format "policies/{policyId}".
// This field is output-only and set by the server.
//
// Follows AEP-122 resource path conventions.
Path *string `json:"path,omitempty"`
// PolicyType Scope of the policy application. This field is immutable after creation.
//
// - GLOBAL: Applies to all requests across the system
// - USER: Applies to requests for a specific user
//
// Policies are evaluated in hierarchical order: Global -> User
PolicyType *PolicyPolicyType `json:"policy_type,omitempty"`
// Priority Priority value for policy evaluation order. Lower numbers have
// higher priority and are evaluated first.
//
// Valid range: 1-1000
// - 1-100: Critical/system policies
// - 101-500: Standard policies
// - 501-1000: Low-priority policies
Priority *int32 `json:"priority,omitempty"`
// RegoCode The OPA Rego policy code. This code is executed when the policy
// is evaluated. Must be valid Rego syntax.
//
// The code should define a package and decision rules. Common patterns:
// - Define a default allow/deny
// - Implement conditional logic based on input
// - Reference data from the policy engine
//
// The Rego code is validated on create and update operations.
RegoCode *string `json:"rego_code,omitempty"`
// UpdateTime Timestamp when the policy was last updated. This field is output-only
// and automatically updated by the server on any modification.
//
// Uses ISO 8601 format with timezone per AEP-140.
UpdateTime *time.Time `json:"update_time,omitempty"`
}
Policy Represents an OPA (Open Policy Agent) policy resource.
Policies define authorization rules using Rego code and can be scoped to different levels (GLOBAL or USER). They are matched against requests using label selectors and evaluated in priority order.
Used for both create (POST) and update (PATCH). On create, display_name, policy_type, and rego_code are required (enforced by the service). On update, only fields present in the request body are merged (RFC 7396).
type PolicyList ¶
type PolicyList struct {
// NextPageToken Token for retrieving the next page of results. If empty or not
// present, there are no more results.
//
// This token is opaque and should not be parsed by clients.
NextPageToken *string `json:"next_page_token,omitempty"`
// Policies List of policy resources matching the request criteria
Policies []Policy `json:"policies"`
}
PolicyList Response message for listing policies.
Implements AEP-132 List standard method requirements.
type PolicyPolicyType ¶
type PolicyPolicyType string
PolicyPolicyType Scope of the policy application. This field is immutable after creation.
- GLOBAL: Applies to all requests across the system - USER: Applies to requests for a specific user
Policies are evaluated in hierarchical order: Global -> User
const ( GLOBAL PolicyPolicyType = "GLOBAL" USER PolicyPolicyType = "USER" )
Defines values for PolicyPolicyType.
type Unauthorized ¶
type Unauthorized = Error
Unauthorized Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.
type UpdatePolicyApplicationMergePatchPlusJSONRequestBody ¶
type UpdatePolicyApplicationMergePatchPlusJSONRequestBody = Policy
UpdatePolicyApplicationMergePatchPlusJSONRequestBody defines body for UpdatePolicy for application/merge-patch+json ContentType.
type ValidationError ¶
type ValidationError = Error
ValidationError Error response following RFC 7807 Problem Details and AEP-193.
Provides structured error information for API failures.