Documentation
¶
Index ¶
Constants ¶
const ( GatewayFunctionalityTypeRegular = "regular" GatewayFunctionalityTypeAI = "ai" GatewayFunctionalityTypeEvent = "event" )
Gateway Functionality Type Constants
const ( RestApi = "RestApi" WebSubApi = "WebSubApi" WebBrokerApi = "WebBrokerApi" LLMProvider = "LlmProvider" LLMProviderTemplate = "LlmProviderTemplate" LLMProxy = "LlmProxy" MCPProxy = "Mcp" )
Kinds of artifacts
const ( OriginCP = "control_plane" OriginDP = "gateway_api" )
Artifact origin values. Origin distinguishes control-plane created artifacts (control_plane) from artifacts pushed up by a data-plane gateway (gateway_api). gateway_api artifacts are read-only in the control plane. The values match the gateway's origin naming (see gateway-controller models.Origin).
const ( APITypeHTTP = "HTTP" APITypeWS = "WS" APITypeSOAPToREST = "SOAPTOREST" APITypeSOAP = "SOAP" APITypeGraphQL = "GRAPHQL" APITypeWebSub = "WEBSUB" APITypeSSE = "SSE" APITypeWebhook = "WEBHOOK" APITypeAsync = "ASYNC" )
API Type Constants
const ( APISubTypeHTTP = "REST" APISubTypeGraphQL = "GQL" APISubTypeAsync = "ASYNC" APISubTypeWebSocket = "WEBSOCKET" APISubTypeSOAP = "SOAP" )
API SubType Constants
const ( GatewayApiVersionV1Alpha1 = "gateway.api-platform.wso2.com/v1alpha1" GatewayApiVersion = "gateway.api-platform.wso2.com/v1" )
Gateway artifact apiVersion (the `apiVersion:` field on deployment artifacts). GatewayApiVersionV1Alpha1 is the legacy value for gateways < 1.2.0 — use it only in down-convert paths (gatewaytranslator) that must produce artifacts consumable by old gateways. New code should use GatewayApiVersion.
const ( APIVersion = "v0.9" APIBasePath = "/api/" + APIVersion )
Platform-api resource URL version. APIBasePath is the single source of truth for the prefix every handler route group is mounted under. NOTE: this is a DIFFERENT axis from GatewayApiVersion* (the gateway artifact apiVersion) — the two are governed independently and currently hold different values ("v0.9" vs "v1").
const ( PolicyManagedByOrganization = "organization" PolicyManagedByWSO2 = "wso2" PolicyManagedByLegacyCustomer = "customer" )
Custom Policy ManagedBy constants
const ( APIKeyStatusActive = "active" APIKeyStatusRevoked = "revoked" )
API key status constants
const ( GatewayTokenStatusActive = "active" GatewayTokenStatusRevoked = "revoked" )
Gateway token status constants
const ( ThrottleLimitUnitMinute = "MINUTE" ThrottleLimitUnitHour = "HOUR" ThrottleLimitUnitDay = "DAY" ThrottleLimitUnitMonth = "MONTH" )
Throttle limit unit constants
const ( LimitTypeRequestCount = "REQUEST_COUNT" LimitTypeBandwidth = "BANDWIDTH" LimitTypeTotalToken = "TOTAL_TOKEN_COUNT" )
Subscription plan limit type constants (subscription_plan_limits.limit_type). NOTE: only LimitTypeRequestCount is currently produced/consumed; BANDWIDTH and token-based types exist in the schema but are not yet wired through the platform-api, gateway events or gateway-controller.
const ( // MetadataKeyEndpointUrl is the metadata key for the per-deployment endpoint URL override. MetadataKeyEndpointUrl = "endpointUrl" // MetadataKeyVhostMain is the metadata key for the per-deployment main vhost value. MetadataKeyVhostMain = "vhostMain" // MetadataKeyVhostSandbox is the metadata key for the per-deployment sandbox vhost value. MetadataKeyVhostSandbox = "vhostSandbox" // VhostGatewayDefault is the sentinel value that instructs the gateway-controller to resolve // and persist the current gateway default vhosts, ensuring deployments are immune to future // gateway config changes. VhostGatewayDefault = "_gateway_default_" )
Metadata key constants for deployment metadata
const APIKeyAllowedTargetsAll = "ALL"
API Key allowed targets constants
const AdminRole = "admin"
AdminRole is the role name that grants administrative privileges
const (
AssociationTypeGateway = "gateway"
)
Constants for association types
const DefaultGatewayFunctionalityType = GatewayFunctionalityTypeRegular
DefaultGatewayFunctionalityType Default gateway functionality type for new gateways
const DeletedUser = "deleted_user"
DeletedUser is returned for audit-identity fields (createdBy/updatedBy/ revokedBy/performedBy) and external/data-plane events when the stored internal UUID has no entry in user_idp_references — an anonymous write, or a user whose mapping was removed.
const (
// DeploymentLimitBuffer is the buffer added to MaxPerAPIGateway for hard limit enforcement
DeploymentLimitBuffer = 100
)
Deployment limit constants
const TemplateManagedByOrganization = "organization"
Variables ¶
var SecretPlaceholderRe = regexp.MustCompile(`\{\{\s*secret\s+\\?"([^"\\]+)\\?"\s*\}\}`)
SecretPlaceholderRe matches {{ secret "handle" }} (and the escaped-quote variant {{ secret \"handle\" }}) in artifact config blobs. A single definition here ensures ref-extraction (repository) and ref-validation (service) always match the same set.
var ValidAPIKeyStatuses = map[string]bool{ APIKeyStatusActive: true, APIKeyStatusRevoked: true, }
ValidAPIKeyStatuses holds accepted values for api_keys.status
var ValidAPITypes = map[string]bool{ "HTTP": true, "WS": true, "SOAPTOREST": true, "SOAP": true, "GRAPHQL": true, "WEBSUB": true, "SSE": true, "WEBHOOK": true, "ASYNC": true, }
ValidAPITypes Valid API types
var ValidArtifactKinds = map[string]bool{ RestApi: true, LLMProvider: true, LLMProxy: true, MCPProxy: true, }
ValidArtifactKinds holds accepted values for artifacts.type for the core (non-plugin) artifact kinds. Plugin-owned kinds (e.g. WebSubApi, WebBrokerApi) are registered into the ArtifactTableRegistry during plugin Init.
var ValidGatewayFunctionalityType = map[string]bool{ GatewayFunctionalityTypeRegular: true, GatewayFunctionalityTypeAI: true, GatewayFunctionalityTypeEvent: true, }
ValidGatewayFunctionalityType Valid gateway functionality types
var ValidGatewayTokenStatuses = map[string]bool{ GatewayTokenStatusActive: true, GatewayTokenStatusRevoked: true, }
ValidGatewayTokenStatuses holds accepted values for gateway_tokens.status
var ValidLifecycleStates = map[string]bool{ "STAGED": true, "CREATED": true, "PUBLISHED": true, "DEPRECATED": true, "RETIRED": true, "BLOCKED": true, }
ValidLifecycleStates Valid lifecycle states
var ValidPolicyManagedBy = map[string]bool{ PolicyManagedByOrganization: true, PolicyManagedByWSO2: true, }
ValidPolicyManagedBy holds accepted values for the managed_by field on gateway custom policies
var ValidThrottleLimitUnits = map[string]bool{ ThrottleLimitUnitMinute: true, ThrottleLimitUnitHour: true, ThrottleLimitUnitDay: true, ThrottleLimitUnitMonth: true, }
ValidThrottleLimitUnits holds accepted values for subscription_plan_limits.time_unit
var ValidTransports = map[string]bool{ "http": true, "https": true, "ws": true, "wss": true, }
ValidTransports Valid transport protocols
Functions ¶
This section is empty.
Types ¶
This section is empty.