constants

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GatewayFunctionalityTypeRegular = "regular"
	GatewayFunctionalityTypeAI      = "ai"
	GatewayFunctionalityTypeEvent   = "event"
)

Gateway Functionality Type Constants

View Source
const (
	RestApi             = "RestApi"
	WebSubApi           = "WebSubApi"
	WebBrokerApi        = "WebBrokerApi"
	LLMProvider         = "LlmProvider"
	LLMProviderTemplate = "LlmProviderTemplate"
	LLMProxy            = "LlmProxy"
	MCPProxy            = "Mcp"
)

Kinds of artifacts

View Source
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).

View Source
const (
	APITypeHTTP       = "HTTP"
	APITypeWS         = "WS"
	APITypeSOAPToREST = "SOAPTOREST"
	APITypeSOAP       = "SOAP"
	APITypeGraphQL    = "GRAPHQL"
	APITypeWebSub     = "WEBSUB"
	APITypeSSE        = "SSE"
	APITypeWebhook    = "WEBHOOK"
	APITypeAsync      = "ASYNC"
)

API Type Constants

View Source
const (
	APISubTypeHTTP      = "REST"
	APISubTypeGraphQL   = "GQL"
	APISubTypeAsync     = "ASYNC"
	APISubTypeWebSocket = "WEBSOCKET"
	APISubTypeSOAP      = "SOAP"
)

API SubType Constants

View Source
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.

View Source
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").

View Source
const (
	PolicyManagedByOrganization   = "organization"
	PolicyManagedByWSO2           = "wso2"
	PolicyManagedByLegacyCustomer = "customer"
)

Custom Policy ManagedBy constants

View Source
const (
	APIKeyStatusActive  = "active"
	APIKeyStatusRevoked = "revoked"
)

API key status constants

View Source
const (
	GatewayTokenStatusActive  = "active"
	GatewayTokenStatusRevoked = "revoked"
)

Gateway token status constants

View Source
const (
	ThrottleLimitUnitMinute = "MINUTE"
	ThrottleLimitUnitHour   = "HOUR"
	ThrottleLimitUnitDay    = "DAY"
	ThrottleLimitUnitMonth  = "MONTH"
)

Throttle limit unit constants

View Source
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.

View Source
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

View Source
const APIKeyAllowedTargetsAll = "ALL"

API Key allowed targets constants

View Source
const AdminRole = "admin"

AdminRole is the role name that grants administrative privileges

View Source
const (
	AssociationTypeGateway = "gateway"
)

Constants for association types

View Source
const DefaultGatewayFunctionalityType = GatewayFunctionalityTypeRegular

DefaultGatewayFunctionalityType Default gateway functionality type for new gateways

View Source
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.

View Source
const (
	// DeploymentLimitBuffer is the buffer added to MaxPerAPIGateway for hard limit enforcement
	DeploymentLimitBuffer = 100
)

Deployment limit constants

View Source
const TemplateManagedByOrganization = "organization"

Variables

View Source
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.

View Source
var ValidAPIKeyStatuses = map[string]bool{
	APIKeyStatusActive:  true,
	APIKeyStatusRevoked: true,
}

ValidAPIKeyStatuses holds accepted values for api_keys.status

View Source
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

View Source
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.

ValidGatewayFunctionalityType Valid gateway functionality types

ValidGatewayTokenStatuses holds accepted values for gateway_tokens.status

View Source
var ValidLifecycleStates = map[string]bool{
	"STAGED":     true,
	"CREATED":    true,
	"PUBLISHED":  true,
	"DEPRECATED": true,
	"RETIRED":    true,
	"BLOCKED":    true,
}

ValidLifecycleStates Valid lifecycle states

ValidPolicyManagedBy holds accepted values for the managed_by field on gateway custom policies

ValidThrottleLimitUnits holds accepted values for subscription_plan_limits.time_unit

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL