Documentation
¶
Index ¶
- Constants
- func AgentRoutePath(sandboxName, agentNamespace, agentName string) string
- func ExtAuthOpenBaoName(namespace string) string
- func Gateway(namespace string) *gwv1.Gateway
- func IndexSandboxMCPConnections(ctx context.Context, idx client.FieldIndexer) error
- func LoadConnections(ctx context.Context, c client.Reader, env *agentzv1alpha1.Sandbox) ([]agentzv1alpha1.MCPConnection, error)
- func MCPConnectionRefNames(env *agentzv1alpha1.Sandbox) []string
- func ManagedRef(namespace, name string) *agentzv1alpha1.MCPConnectionManagedResourceRef
- func SandboxAuthPolicyName(sandboxName, connectionName string) string
- func SandboxBackendName(name string) string
- func SandboxRouteName(name string) string
- func SecretPath(namespace, name string) string
- type BearerSecretRecord
- type OAuthSecretRecord
- type Target
Constants ¶
const ( // SandboxByMCPConnectionIndex indexes Sandboxes by MCP connection name. SandboxByMCPConnectionIndex = "spec.mcpConnectionRefs.name" // MCPConnectionFinalizer retains connections until runtime cleanup completes. MCPConnectionFinalizer = "agentz.accuknox.com/mcpconnection" // SandboxFinalizer retains Sandboxes while their MCP resources exist. SandboxFinalizer = "agentz.accuknox.com/sandbox-protection" // OpenCodeGatewayToolsetName names the gateway toolset in OpenCode config. OpenCodeGatewayToolsetName = "gateway" // SecretPathDir is the OpenBao directory for MCP credential records. SecretPathDir = "mcp-connections" // GatewayClassName selects the AgentGateway controller. GatewayClassName = "agentgateway" // GatewayName names the namespace-local MCP Gateway. GatewayName = "mcp" // ExtAuthServiceName names the credential injection Service. ExtAuthServiceName = "extauth" // ExtAuthRolePrefix prefixes namespace-specific OpenBao roles. ExtAuthRolePrefix = "extauth-" // ExtAuthPort is the ext_authz gRPC port. ExtAuthPort int32 = 18081 // ExtAuthMCPPort is the internal MCP helper HTTP port. ExtAuthMCPPort int32 = 18082 // ExtAuthMCPPath is the internal MCP helper route. ExtAuthMCPPath = "/mcp" // MCPHelperTargetName identifies the internal helper in MCP targets. MCPHelperTargetName = "agentz-internal" // AppProtocolMCP marks Services that expose the MCP protocol. AppProtocolMCP = "agentgateway.dev/mcp" // AgentgatewayParametersName is the name of the AgentgatewayParameters // resource that configures the Gateway proxy Service type. AgentgatewayParametersName = "mcp-clusterip" )
const ( ConditionAccepted = "Accepted" ConditionReady = "Ready" ConditionDegraded = "Degraded" ConditionExtAuthReady = "ExtAuthReady" ConditionProbeHealthy = "ProbeHealthy" ConditionConnectionUnreachable = "ConnectionUnreachable" ConditionCredentialsInvalid = "CredentialsInvalid" ConditionInternalError = "InternalError" ConditionProtocolError = "ProtocolError" )
MCPConnection condition types shared by the controller, observer, and gateway.
const ( ReasonAccepted = "Accepted" ReasonReady = "Ready" ReasonReconcileFailed = "ReconcileFailed" ReasonProbePending = "ProbePending" ReasonConnectionUnreachable = "ConnectionUnreachable" ReasonCredentialsInvalid = "CredentialsInvalid" ReasonInternalError = "InternalError" ReasonProtocolError = "ProtocolError" )
MCPConnection condition reasons shared by the controller and observer.
const SecretRecordKey = "credentials"
SecretRecordKey is the OpenBao field key for stored MCP credentials.
Variables ¶
This section is empty.
Functions ¶
func AgentRoutePath ¶
AgentRoutePath returns the stable path that gateway policy binds to one Agent identity before forwarding traffic to its Sandbox backend.
func ExtAuthOpenBaoName ¶
ExtAuthOpenBaoName returns the shared OpenBao role and policy name.
func IndexSandboxMCPConnections ¶
func IndexSandboxMCPConnections(ctx context.Context, idx client.FieldIndexer) error
IndexSandboxMCPConnections registers the sandbox MCP ref index.
func LoadConnections ¶
func LoadConnections(ctx context.Context, c client.Reader, env *agentzv1alpha1.Sandbox) ([]agentzv1alpha1.MCPConnection, error)
LoadConnections returns live MCPConnection objects referenced by env.
Missing references are ignored so callers can converge runtime state from currently resolvable connections.
func MCPConnectionRefNames ¶
func MCPConnectionRefNames(env *agentzv1alpha1.Sandbox) []string
MCPConnectionRefNames returns trimmed, non-empty MCP connection names.
func ManagedRef ¶
func ManagedRef(namespace, name string) *agentzv1alpha1.MCPConnectionManagedResourceRef
ManagedRef returns a status reference for one namespaced object.
func SandboxAuthPolicyName ¶
SandboxAuthPolicyName returns the auth policy name for one sandbox and connection pair.
func SandboxBackendName ¶
SandboxBackendName returns the MCP backend name for one sandbox.
func SandboxRouteName ¶
SandboxRouteName returns the HTTPRoute name for one sandbox.
func SecretPath ¶
SecretPath returns the stable namespace-scoped OpenBao path for one MCP credential record.
Types ¶
type BearerSecretRecord ¶
type BearerSecretRecord struct {
Token string `json:"token"`
UpdatedAt time.Time `json:"updatedAt"`
}
BearerSecretRecord stores one bearer credential in OpenBao.
type OAuthSecretRecord ¶
OAuthSecretRecord stores one OAuth credential record in OpenBao.
type Target ¶
type Target struct {
Host string
Port int32
Path *string
Protocol *agentgatewayv1alpha1.MCPProtocol
Secure bool
}
Target describes one resolved MCP upstream target.
func ParseTarget ¶
func ParseTarget(conn *agentzv1alpha1.MCPConnection) (Target, error)
ParseTarget resolves one MCPConnection into the runtime target shape.