Documentation
¶
Overview ¶
Upstream credential redaction for management API responses.
An upstream credential is write-only: accepted on create/update and never returned by the management API on a read, for any role. A credential reaches an auth block through one of two mechanisms, and both must be cleared:
- `value`, the deprecated api-key form. The corresponding properties in management-openapi.yaml are marked `writeOnly: true`.
- `policyParams`, the free-form bucket. For "oauth2" and "other" it is the only credential mechanism there is — it carries `clientSecret`, `bearerToken` and whatever else the named policy expects. For "api-key" it replaces the deprecated header/value pair.
`policyParams` is dropped whole rather than scrubbed key by key. Its contents are defined by whichever policy consumes it, so there is no closed set of credential-bearing names to match on, and a denylist that misses one discloses it. Dropping the bucket costs nothing on update: an auth block that carries no credential inherits the stored one (see pkg/utils/credential_inheritance.go), which is what keeps read-modify-write working.
These functions operate on the re-materialised configuration produced by each rematerialize*Config round-trip — a response-bound copy — never on a StoredConfig's own SourceConfiguration, which is what each replica re-renders on consumption.
Index ¶
- type APIServer
- func (s *APIServer) BuildConfigDumpResponse(log *slog.Logger) (*adminapi.ConfigDumpResponse, error)
- func (s *APIServer) ConfigDumpJSON(log *slog.Logger) ([]byte, error)
- func (s *APIServer) CreateAPIKey(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) CreateAgentAPIKey(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) CreateGraphQLAPI(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) CreateLLMProvider(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) CreateLLMProviderTemplate(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateLLMProxy(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) CreateMCPProxy(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateSecret(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateSubscription(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) CreateSubscriptionPlan(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) DeleteCertificate(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteGraphQLAPI(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteLLMProvider(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteLLMProviderTemplate(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteLLMProxy(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteMCPProxy(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteSecret(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) DeleteSubscription(w http.ResponseWriter, r *http.Request, subscriptionId string)
- func (s *APIServer) DeleteSubscriptionPlan(w http.ResponseWriter, r *http.Request, planId string)
- func (s *APIServer) GetAPIByNameVersion(w http.ResponseWriter, r *http.Request, name string, version string)
- func (s *APIServer) GetConfigDump(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) GetGraphQLAPIById(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetLLMProviderById(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetLLMProviderTemplateById(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetLLMProxyById(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetMCPProxyById(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetSecret(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) GetSubscription(w http.ResponseWriter, r *http.Request, subscriptionId string)
- func (s *APIServer) GetSubscriptionPlan(w http.ResponseWriter, r *http.Request, planId string)
- func (s *APIServer) GetXDSSyncStatus(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) GetXDSSyncStatusResponse() adminapi.XDSSyncStatusResponse
- func (s *APIServer) ListAPIKeys(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) ListAgentAPIKeys(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) ListCertificates(w http.ResponseWriter, r *http.Request, params api.ListCertificatesParams)
- func (s *APIServer) ListGraphQLAPIKeys(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) ListGraphQLAPIs(w http.ResponseWriter, r *http.Request, params api.ListGraphQLAPIsParams)
- func (s *APIServer) ListLLMProviderAPIKeys(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) ListLLMProviderTemplates(w http.ResponseWriter, r *http.Request, ...)
- func (s *APIServer) ListLLMProviders(w http.ResponseWriter, r *http.Request, params api.ListLLMProvidersParams)
- func (s *APIServer) ListLLMProxies(w http.ResponseWriter, r *http.Request, params api.ListLLMProxiesParams)
- func (s *APIServer) ListLLMProxyAPIKeys(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) ListMCPProxies(w http.ResponseWriter, r *http.Request, params api.ListMCPProxiesParams)
- func (s *APIServer) ListSecrets(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) ListSubscriptionPlans(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) ListSubscriptions(w http.ResponseWriter, r *http.Request, params api.ListSubscriptionsParams)
- func (s *APIServer) RegenerateAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RegenerateAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RegenerateGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RegenerateLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RegenerateLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) ReloadCertificates(w http.ResponseWriter, r *http.Request)
- func (s *APIServer) RevokeAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RevokeAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RevokeGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RevokeLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) RevokeLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) SearchDeployments(w http.ResponseWriter, r *http.Request, kind string)
- func (s *APIServer) SetEncryptionManager(mgr *encryption.ProviderManager)
- func (s *APIServer) UpdateAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) UpdateAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) UpdateCertificate(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateGraphQLAPI(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) UpdateLLMProvider(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) UpdateLLMProviderTemplate(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateLLMProxy(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
- func (s *APIServer) UpdateMCPProxy(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateSecret(w http.ResponseWriter, r *http.Request, id string)
- func (s *APIServer) UpdateSubscription(w http.ResponseWriter, r *http.Request, subscriptionId string)
- func (s *APIServer) UpdateSubscriptionPlan(w http.ResponseWriter, r *http.Request, planId string)
- func (s *APIServer) UploadCertificate(w http.ResponseWriter, r *http.Request)
- type AgentHandler
- func (h *AgentHandler) CreateAgent(w http.ResponseWriter, r *http.Request)
- func (h *AgentHandler) DeleteAgent(w http.ResponseWriter, r *http.Request, id string)
- func (h *AgentHandler) GetAgentById(w http.ResponseWriter, r *http.Request, id string)
- func (h *AgentHandler) ListAgents(w http.ResponseWriter, r *http.Request, params api.ListAgentsParams)
- func (h *AgentHandler) UpdateAgent(w http.ResponseWriter, r *http.Request, id string)
- type CertificateResponse
- type ListCertificatesResponse
- type RestAPIHandler
- func (h *RestAPIHandler) CreateRestAPI(w http.ResponseWriter, r *http.Request)
- func (h *RestAPIHandler) DeleteRestAPI(w http.ResponseWriter, r *http.Request, id string)
- func (h *RestAPIHandler) GetRestAPIById(w http.ResponseWriter, r *http.Request, id string)
- func (h *RestAPIHandler) ListRestAPIs(w http.ResponseWriter, r *http.Request, params api.ListRestAPIsParams)
- func (h *RestAPIHandler) UpdateRestAPI(w http.ResponseWriter, r *http.Request, id string)
- type UploadCertificateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct {
*RestAPIHandler // embedded — promotes CreateRestAPI, ListRestAPIs, GetRestAPIById, UpdateRestAPI, DeleteRestAPI
*AgentHandler // embedded — promotes CreateAgent, ListAgents, GetAgentById, UpdateAgent, DeleteAgent
// contains filtered or unexported fields
}
APIServer implements the generated ServerInterface
func NewAPIServer ¶
func NewAPIServer( store *storage.ConfigStore, db storage.Storage, snapshotManager *xds.SnapshotManager, policyManager *policyxds.PolicyManager, lazyResourceManager *lazyresourcexds.LazyResourceStateManager, clientAuthorities *utils.ClientAuthorityPublisher, logger *slog.Logger, controlPlaneClient controlplane.ControlPlaneClient, policyDefinitions map[string]models.PolicyDefinition, templateDefinitions map[string]*api.LLMProviderTemplate, validator config.Validator, apiKeyXDSManager *apikeyxds.APIKeyStateManager, systemConfig *config.Config, eventHub eventhub.EventHub, subscriptionSnapshotUpdater utils.SubscriptionSnapshotUpdater, secretService *secrets.SecretService, restAPIService *restapi.RestAPIService, httpClient *http.Client, agentService *agent.AgentService, ) (*APIServer, error)
NewAPIServer creates a new API server with dependencies
func (*APIServer) BuildConfigDumpResponse ¶
BuildConfigDumpResponse builds the complete configuration dump response payload.
func (*APIServer) ConfigDumpJSON ¶
ConfigDumpJSON builds the configuration dump and returns it as JSON with every resolved secret value redacted.
The dump serves cfg.Configuration, which is the *rendered* configuration — a `{{ secret "..." }}` in an upstream credential appears there as the plaintext it resolved to. Redaction is therefore not cosmetic, and it has to happen on every route that serves this payload, which is why both the management API and the admin server go through here rather than marshalling the response themselves.
func (*APIServer) CreateAPIKey ¶
CreateAPIKey implements ServerInterface.CreateAPIKey (POST /apis/{id}/api-keys) Handles both local key generation and external key injection based on request payload
func (*APIServer) CreateAgentAPIKey ¶
CreateAgentAPIKey implements ServerInterface.CreateAgentAPIKey (POST /agents/{id}/api-keys)
func (*APIServer) CreateGraphQLAPI ¶
func (s *APIServer) CreateGraphQLAPI(w http.ResponseWriter, r *http.Request)
CreateGraphQLAPI implements ServerInterface.CreateGraphQLAPI (POST /graphql-apis)
func (*APIServer) CreateGraphQLAPIKey ¶
CreateGraphQLAPIKey implements ServerInterface.CreateGraphQLAPIKey (POST /graphql-apis/{id}/api-keys)
func (*APIServer) CreateLLMProvider ¶
func (s *APIServer) CreateLLMProvider(w http.ResponseWriter, r *http.Request)
CreateLLMProvider implements ServerInterface.CreateLLMProvider (POST /llm-providers)
func (*APIServer) CreateLLMProviderAPIKey ¶
CreateLLMProviderAPIKey implements ServerInterface.CreateLLMProviderAPIKey (POST /llm-providers/{id}/api-keys)
func (*APIServer) CreateLLMProviderTemplate ¶
func (s *APIServer) CreateLLMProviderTemplate(w http.ResponseWriter, r *http.Request)
CreateLLMProviderTemplate implements ServerInterface.CreateLLMProviderTemplate (POST /llm-provider-templates)
func (*APIServer) CreateLLMProxy ¶
func (s *APIServer) CreateLLMProxy(w http.ResponseWriter, r *http.Request)
CreateLLMProxy implements ServerInterface.CreateLLMProxy (POST /llm-proxies)
func (*APIServer) CreateLLMProxyAPIKey ¶
CreateLLMProxyAPIKey implements ServerInterface.CreateLLMProxyAPIKey (POST /llm-proxies/{id}/api-keys)
func (*APIServer) CreateMCPProxy ¶
func (s *APIServer) CreateMCPProxy(w http.ResponseWriter, r *http.Request)
CreateMCPProxy implements ServerInterface.CreateMCPProxy (POST /mcp-proxies)
func (*APIServer) CreateSecret ¶
func (s *APIServer) CreateSecret(w http.ResponseWriter, r *http.Request)
CreateSecret handles POST /secrets
func (*APIServer) CreateSubscription ¶
func (s *APIServer) CreateSubscription(w http.ResponseWriter, r *http.Request)
CreateSubscription implements ServerInterface.CreateSubscription (POST /subscriptions)
func (*APIServer) CreateSubscriptionPlan ¶
func (s *APIServer) CreateSubscriptionPlan(w http.ResponseWriter, r *http.Request)
CreateSubscriptionPlan implements ServerInterface.CreateSubscriptionPlan (POST /subscription-plans)
func (*APIServer) DeleteCertificate ¶
DeleteCertificate deletes a certificate by ID DELETE /certificates/:id
func (*APIServer) DeleteGraphQLAPI ¶
DeleteGraphQLAPI implements ServerInterface.DeleteGraphQLAPI (DELETE /graphql-apis/{id})
func (*APIServer) DeleteLLMProvider ¶
DeleteLLMProvider implements ServerInterface.DeleteLLMProvider (DELETE /llm-providers/{id})
func (*APIServer) DeleteLLMProviderTemplate ¶
DeleteLLMProviderTemplate implements ServerInterface.DeleteLLMProviderTemplate (DELETE /llm-provider-templates/{id})
func (*APIServer) DeleteLLMProxy ¶
DeleteLLMProxy implements ServerInterface.DeleteLLMProxy (DELETE /llm-proxies/{id})
func (*APIServer) DeleteMCPProxy ¶
DeleteMCPProxy implements ServerInterface.DeleteMCPProxy (DELETE /mcp-proxies/{handle})
func (*APIServer) DeleteSecret ¶
DeleteSecret handles DELETE /secrets/{id}
func (*APIServer) DeleteSubscription ¶
func (s *APIServer) DeleteSubscription(w http.ResponseWriter, r *http.Request, subscriptionId string)
DeleteSubscription implements ServerInterface.DeleteSubscription (DELETE /subscriptions/{subscriptionId})
func (*APIServer) DeleteSubscriptionPlan ¶
DeleteSubscriptionPlan implements ServerInterface.DeleteSubscriptionPlan (DELETE /subscription-plans/{planId})
func (*APIServer) GetAPIByNameVersion ¶
func (s *APIServer) GetAPIByNameVersion(w http.ResponseWriter, r *http.Request, name string, version string)
GetAPIByNameVersion implements ServerInterface.GetAPIByNameVersion (GET /apis/{name}/{version})
func (*APIServer) GetConfigDump ¶
func (s *APIServer) GetConfigDump(w http.ResponseWriter, r *http.Request)
GetConfigDump implements the GET /config_dump endpoint
func (*APIServer) GetGraphQLAPIById ¶
GetGraphQLAPIById implements ServerInterface.GetGraphQLAPIById (GET /graphql-apis/{id})
func (*APIServer) GetLLMProviderById ¶
GetLLMProviderById implements ServerInterface.GetLLMProviderById (GET /llm-providers/{id})
func (*APIServer) GetLLMProviderTemplateById ¶
GetLLMProviderTemplateById implements ServerInterface.GetLLMProviderTemplateById (GET /llm-provider-templates/{id})
func (*APIServer) GetLLMProxyById ¶
GetLLMProxyById implements ServerInterface.GetLLMProxyById (GET /llm-proxies/{id})
func (*APIServer) GetMCPProxyById ¶
GetMCPProxyById implements ServerInterface.GetMCPProxyById (GET /mcp-proxies/{id})
func (*APIServer) GetSubscription ¶
GetSubscription implements ServerInterface.GetSubscription (GET /subscriptions/{subscriptionId})
func (*APIServer) GetSubscriptionPlan ¶
GetSubscriptionPlan implements ServerInterface.GetSubscriptionPlan (GET /subscription-plans/{planId})
func (*APIServer) GetXDSSyncStatus ¶
func (s *APIServer) GetXDSSyncStatus(w http.ResponseWriter, r *http.Request)
GetXDSSyncStatus implements the GET /xds_sync_status endpoint.
func (*APIServer) GetXDSSyncStatusResponse ¶
func (s *APIServer) GetXDSSyncStatusResponse() adminapi.XDSSyncStatusResponse
GetXDSSyncStatusResponse builds the xDS sync status response payload.
func (*APIServer) ListAPIKeys ¶
ListAPIKeys implements ServerInterface.ListAPIKeys (GET /apis/{id}/api-keys)
func (*APIServer) ListAgentAPIKeys ¶
ListAgentAPIKeys implements ServerInterface.ListAgentAPIKeys (GET /agents/{id}/api-keys)
func (*APIServer) ListCertificates ¶
func (s *APIServer) ListCertificates(w http.ResponseWriter, r *http.Request, params api.ListCertificatesParams)
ListCertificates lists all custom certificates, optionally filtered by usage GET /certificates
func (*APIServer) ListGraphQLAPIKeys ¶
ListGraphQLAPIKeys implements ServerInterface.ListGraphQLAPIKeys (GET /graphql-apis/{id}/api-keys)
func (*APIServer) ListGraphQLAPIs ¶
func (s *APIServer) ListGraphQLAPIs(w http.ResponseWriter, r *http.Request, params api.ListGraphQLAPIsParams)
ListGraphQLAPIs implements ServerInterface.ListGraphQLAPIs (GET /graphql-apis)
func (*APIServer) ListLLMProviderAPIKeys ¶
ListLLMProviderAPIKeys implements ServerInterface.ListLLMProviderAPIKeys (GET /llm-providers/{id}/api-keys)
func (*APIServer) ListLLMProviderTemplates ¶
func (s *APIServer) ListLLMProviderTemplates(w http.ResponseWriter, r *http.Request, params api.ListLLMProviderTemplatesParams)
ListLLMProviderTemplates implements ServerInterface.ListLLMProviderTemplates (GET /llm-providers/templates)
func (*APIServer) ListLLMProviders ¶
func (s *APIServer) ListLLMProviders(w http.ResponseWriter, r *http.Request, params api.ListLLMProvidersParams)
ListLLMProviders implements ServerInterface.ListLLMProviders (GET /llm-providers)
func (*APIServer) ListLLMProxies ¶
func (s *APIServer) ListLLMProxies(w http.ResponseWriter, r *http.Request, params api.ListLLMProxiesParams)
ListLLMProxies implements ServerInterface.ListLLMProxies (GET /llm-proxies)
func (*APIServer) ListLLMProxyAPIKeys ¶
ListLLMProxyAPIKeys implements ServerInterface.ListLLMProxyAPIKeys (GET /llm-proxies/{id}/api-keys)
func (*APIServer) ListMCPProxies ¶
func (s *APIServer) ListMCPProxies(w http.ResponseWriter, r *http.Request, params api.ListMCPProxiesParams)
ListMCPProxies implements ServerInterface.ListMCPProxies (GET /mcp-proxies)
func (*APIServer) ListSecrets ¶
func (s *APIServer) ListSecrets(w http.ResponseWriter, r *http.Request)
ListSecrets implements ServerInterface.ListSecrets (GET /secrets)
func (*APIServer) ListSubscriptionPlans ¶
func (s *APIServer) ListSubscriptionPlans(w http.ResponseWriter, r *http.Request)
ListSubscriptionPlans implements ServerInterface.ListSubscriptionPlans (GET /subscription-plans)
func (*APIServer) ListSubscriptions ¶
func (s *APIServer) ListSubscriptions(w http.ResponseWriter, r *http.Request, params api.ListSubscriptionsParams)
ListSubscriptions implements ServerInterface.ListSubscriptions (GET /subscriptions)
func (*APIServer) RegenerateAPIKey ¶
func (s *APIServer) RegenerateAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RegenerateAPIKey implements ServerInterface.RegenerateAPIKey (POST /apis/{id}/api-keys/{apiKeyName}/regenerate)
func (*APIServer) RegenerateAgentAPIKey ¶
func (s *APIServer) RegenerateAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RegenerateAgentAPIKey implements ServerInterface.RegenerateAgentAPIKey (POST /agents/{id}/api-keys/{apiKeyName}/regenerate)
func (*APIServer) RegenerateGraphQLAPIKey ¶
func (s *APIServer) RegenerateGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RegenerateGraphQLAPIKey implements ServerInterface.RegenerateGraphQLAPIKey (POST /graphql-apis/{id}/api-keys/{apiKeyName}/regenerate)
func (*APIServer) RegenerateLLMProviderAPIKey ¶
func (s *APIServer) RegenerateLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RegenerateLLMProviderAPIKey implements ServerInterface.RegenerateLLMProviderAPIKey (POST /llm-providers/{id}/api-keys/{apiKeyName}/regenerate)
func (*APIServer) RegenerateLLMProxyAPIKey ¶
func (s *APIServer) RegenerateLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RegenerateLLMProxyAPIKey implements ServerInterface.RegenerateLLMProxyAPIKey (POST /llm-proxies/{id}/api-keys/{apiKeyName}/regenerate)
func (*APIServer) ReloadCertificates ¶
func (s *APIServer) ReloadCertificates(w http.ResponseWriter, r *http.Request)
ReloadCertificates manually triggers certificate reload and SDS update POST /certificates/reload
func (*APIServer) RevokeAPIKey ¶
func (s *APIServer) RevokeAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RevokeAPIKey implements ServerInterface.RevokeAPIKey (DELETE /apis/{id}/api-keys/{apiKeyName})
func (*APIServer) RevokeAgentAPIKey ¶
func (s *APIServer) RevokeAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RevokeAgentAPIKey implements ServerInterface.RevokeAgentAPIKey (DELETE /agents/{id}/api-keys/{apiKeyName})
func (*APIServer) RevokeGraphQLAPIKey ¶
func (s *APIServer) RevokeGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RevokeGraphQLAPIKey implements ServerInterface.RevokeGraphQLAPIKey (DELETE /graphql-apis/{id}/api-keys/{apiKeyName})
func (*APIServer) RevokeLLMProviderAPIKey ¶
func (s *APIServer) RevokeLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RevokeLLMProviderAPIKey implements ServerInterface.RevokeLLMProviderAPIKey (DELETE /llm-providers/{id}/api-keys/{apiKeyName})
func (*APIServer) RevokeLLMProxyAPIKey ¶
func (s *APIServer) RevokeLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
RevokeLLMProxyAPIKey implements ServerInterface.RevokeLLMProxyAPIKey (DELETE /llm-proxies/{id}/api-keys/{apiKeyName})
func (*APIServer) SearchDeployments ¶
func (*APIServer) SetEncryptionManager ¶
func (s *APIServer) SetEncryptionManager(mgr *encryption.ProviderManager)
SetEncryptionManager wires the encryption provider manager used to encrypt a gateway identity's private key before it is persisted.
func (*APIServer) UpdateAPIKey ¶
func (s *APIServer) UpdateAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
UpdateAPIKey implements ServerInterface.UpdateAPIKey (PUT /apis/{id}/api-keys/{apiKeyName})
func (*APIServer) UpdateAgentAPIKey ¶
func (s *APIServer) UpdateAgentAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
UpdateAgentAPIKey implements ServerInterface.UpdateAgentAPIKey (PUT /agents/{id}/api-keys/{apiKeyName})
func (*APIServer) UpdateCertificate ¶
UpdateCertificate rotates a usage: identity certificate's chain and private key in place, keeping its name. Other usages are refused. PUT /certificates/{id}
func (*APIServer) UpdateGraphQLAPI ¶
UpdateGraphQLAPI implements ServerInterface.UpdateGraphQLAPI (PUT /graphql-apis/{id})
func (*APIServer) UpdateGraphQLAPIKey ¶
func (s *APIServer) UpdateGraphQLAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
UpdateGraphQLAPIKey implements ServerInterface.UpdateGraphQLAPIKey (PUT /graphql-apis/{id}/api-keys/{apiKeyName})
func (*APIServer) UpdateLLMProvider ¶
UpdateLLMProvider implements ServerInterface.UpdateLLMProvider (PUT /llm-providers/{id})
func (*APIServer) UpdateLLMProviderAPIKey ¶
func (s *APIServer) UpdateLLMProviderAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
UpdateLLMProviderAPIKey implements ServerInterface.UpdateLLMProviderAPIKey (PUT /llm-providers/{id}/api-keys/{apiKeyName})
func (*APIServer) UpdateLLMProviderTemplate ¶
UpdateLLMProviderTemplate implements ServerInterface.UpdateLLMProviderTemplate (PUT /llm-provider-templates/{id})
func (*APIServer) UpdateLLMProxy ¶
UpdateLLMProxy implements ServerInterface.UpdateLLMProxy (PUT /llm-proxies/{id})
func (*APIServer) UpdateLLMProxyAPIKey ¶
func (s *APIServer) UpdateLLMProxyAPIKey(w http.ResponseWriter, r *http.Request, id string, apiKeyName string)
UpdateLLMProxyAPIKey implements ServerInterface.UpdateLLMProxyAPIKey (PUT /llm-proxies/{id}/api-keys/{apiKeyName})
func (*APIServer) UpdateMCPProxy ¶
UpdateMCPProxy implements ServerInterface.UpdateMCPProxy (PUT /mcp-proxies/{handle})
func (*APIServer) UpdateSecret ¶
UpdateSecret handles PUT /secrets/{id}
func (*APIServer) UpdateSubscription ¶
func (s *APIServer) UpdateSubscription(w http.ResponseWriter, r *http.Request, subscriptionId string)
UpdateSubscription implements ServerInterface.UpdateSubscription (PUT /subscriptions/{subscriptionId})
func (*APIServer) UpdateSubscriptionPlan ¶
UpdateSubscriptionPlan implements ServerInterface.UpdateSubscriptionPlan (PUT /subscription-plans/{planId})
func (*APIServer) UploadCertificate ¶
func (s *APIServer) UploadCertificate(w http.ResponseWriter, r *http.Request)
UploadCertificate handles certificate upload via REST API POST /certificates
type AgentHandler ¶
type AgentHandler struct {
// contains filtered or unexported fields
}
AgentHandler handles HTTP requests for Agent (A2A) CRUD operations.
func NewAgentHandler ¶
func NewAgentHandler(service *agent.AgentService, logger *slog.Logger) *AgentHandler
NewAgentHandler creates a new AgentHandler.
func (*AgentHandler) CreateAgent ¶
func (h *AgentHandler) CreateAgent(w http.ResponseWriter, r *http.Request)
CreateAgent implements ServerInterface.CreateAgent (POST /agents)
func (*AgentHandler) DeleteAgent ¶
func (h *AgentHandler) DeleteAgent(w http.ResponseWriter, r *http.Request, id string)
DeleteAgent implements ServerInterface.DeleteAgent (DELETE /agents/{id})
func (*AgentHandler) GetAgentById ¶
func (h *AgentHandler) GetAgentById(w http.ResponseWriter, r *http.Request, id string)
GetAgentById implements ServerInterface.GetAgentById (GET /agents/{id})
func (*AgentHandler) ListAgents ¶
func (h *AgentHandler) ListAgents(w http.ResponseWriter, r *http.Request, params api.ListAgentsParams)
ListAgents implements ServerInterface.ListAgents (GET /agents)
func (*AgentHandler) UpdateAgent ¶
func (h *AgentHandler) UpdateAgent(w http.ResponseWriter, r *http.Request, id string)
UpdateAgent implements ServerInterface.UpdateAgent (PUT /agents/{id})
type CertificateResponse ¶
type CertificateResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Subject string `json:"subject,omitempty"`
Issuer string `json:"issuer,omitempty"`
NotAfter string `json:"notAfter,omitempty"`
Count int `json:"count"` // Number of certs in file
Usage string `json:"usage"`
Role string `json:"role,omitempty"`
Match *models.CertificateMatch `json:"match,omitempty"`
IsLeaf bool `json:"isLeaf"`
KeyAlgorithm string `json:"keyAlgorithm,omitempty"` // Only present for usage: identity
ChainLength int `json:"chainLength,omitempty"` // Only present for usage: identity
Warnings []clientca.Warning `json:"warnings,omitempty"`
ReferencedByApis *int `json:"referencedByApis,omitempty"`
Message string `json:"message,omitempty"`
Status string `json:"status"` // success, error
}
CertificateResponse represents a certificate information response
type ListCertificatesResponse ¶
type ListCertificatesResponse struct {
Certificates []CertificateResponse `json:"certificates"`
TotalCount int `json:"totalCount"`
TotalBytes int `json:"totalBytes"`
Status string `json:"status"`
}
ListCertificatesResponse represents the response for listing certificates
type RestAPIHandler ¶
type RestAPIHandler struct {
// contains filtered or unexported fields
}
RestAPIHandler handles HTTP requests for REST API CRUD operations.
func NewRestAPIHandler ¶
func NewRestAPIHandler(service *restapi.RestAPIService, logger *slog.Logger) *RestAPIHandler
NewRestAPIHandler creates a new RestAPIHandler.
func (*RestAPIHandler) CreateRestAPI ¶
func (h *RestAPIHandler) CreateRestAPI(w http.ResponseWriter, r *http.Request)
CreateRestAPI implements ServerInterface.CreateRestAPI (POST /rest-apis)
func (*RestAPIHandler) DeleteRestAPI ¶
func (h *RestAPIHandler) DeleteRestAPI(w http.ResponseWriter, r *http.Request, id string)
DeleteRestAPI implements ServerInterface.DeleteRestAPI (DELETE /rest-apis/{id})
func (*RestAPIHandler) GetRestAPIById ¶
func (h *RestAPIHandler) GetRestAPIById(w http.ResponseWriter, r *http.Request, id string)
GetRestAPIById implements ServerInterface.GetRestAPIById (GET /rest-apis/{id})
func (*RestAPIHandler) ListRestAPIs ¶
func (h *RestAPIHandler) ListRestAPIs(w http.ResponseWriter, r *http.Request, params api.ListRestAPIsParams)
ListRestAPIs implements ServerInterface.ListRestAPIs (GET /rest-apis)
func (*RestAPIHandler) UpdateRestAPI ¶
func (h *RestAPIHandler) UpdateRestAPI(w http.ResponseWriter, r *http.Request, id string)
UpdateRestAPI implements ServerInterface.UpdateRestAPI (PUT /rest-apis/{id})
type UploadCertificateRequest ¶
type UploadCertificateRequest struct {
Certificate string `json:"certificate" binding:"required"` // PEM-encoded certificate
Name string `json:"name" binding:"required"` // Unique certificate name
Usage string `json:"usage"` // "upstream" (default), "downstream" or "identity"
Role string `json:"role"` // "client" (default) or "relay" for usage: downstream; "default" for usage: identity
Match *models.CertificateMatch `json:"match,omitempty"` // Only valid for role: relay
PrivateKey string `json:"privateKey,omitempty"` // Required (and only valid) for usage: identity
}
UploadCertificateRequest represents the request body for certificate upload
Source Files
¶
- agent_handler.go
- api_key_handler.go
- certificates.go
- credential_redaction.go
- graphql_api_handler.go
- handlers.go
- helpers.go
- llm_provider_handler.go
- llm_provider_template_handler.go
- llm_proxy_handler.go
- mcp_proxy_handler.go
- resource_response.go
- rest_api_handler.go
- secret_handler.go
- subscription_handler.go
- subscription_plan_handler.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package handlerkit holds generic request-handling infrastructure shared by every gateway-controller API handler kind (REST, LLM, MCP, subscriptions, api-keys, and — in an event-gateway-controller binary — WebSub/WebBroker).
|
Package handlerkit holds generic request-handling infrastructure shared by every gateway-controller API handler kind (REST, LLM, MCP, subscriptions, api-keys, and — in an event-gateway-controller binary — WebSub/WebBroker). |