Documentation
¶
Index ¶
- Constants
- func AuthRequiredError(err error) error
- func HasPlatformClient() bool
- func NormalizeBaseURL(raw string) string
- type AdapterCertificate
- type AdapterCertificateRequest
- type AdapterSession
- type AdapterSessionRequest
- type Agent
- type AgentPage
- type ImagePublishRecord
- type PlatformClient
- func (c *PlatformClient) ApplyAccessFromYAMLFile(ctx context.Context, path string) error
- func (c *PlatformClient) ApplyRuntimeServer(ctx context.Context, name, namespace string, spec mcpv1alpha1.MCPServerSpec) (ServerListItem, error)
- func (c *PlatformClient) ApplyRuntimeServerWithScope(ctx context.Context, name, namespace, scope string, ...) (ServerListItem, error)
- func (c *PlatformClient) ApplyRuntimeServerWithScopeUpdate(ctx context.Context, name, namespace, scope string, ...) (ServerListItem, error)
- func (c *PlatformClient) CreateAdapterSession(ctx context.Context, req AdapterSessionRequest) (AdapterSession, error)
- func (c *PlatformClient) CreateAgent(ctx context.Context, teamSlug, name string) (Agent, error)
- func (c *PlatformClient) CreateTeam(ctx context.Context, slug, name string) (Team, error)
- func (c *PlatformClient) CreateTeamUser(ctx context.Context, slug, email, password, role string) (TeamMembership, error)
- func (c *PlatformClient) CreateUser(ctx context.Context, email, password, role string) (PlatformUser, error)
- func (c *PlatformClient) CurrentPrincipal(ctx context.Context) (Principal, error)
- func (c *PlatformClient) DeleteGrant(ctx context.Context, namespace, name string) error
- func (c *PlatformClient) DeleteRuntimeServer(ctx context.Context, namespace, name string) error
- func (c *PlatformClient) DeleteSession(ctx context.Context, namespace, name string) error
- func (c *PlatformClient) GetAgent(ctx context.Context, id string) (Agent, error)
- func (c *PlatformClient) GetGrant(ctx context.Context, namespace, name string) (sentinelaccess.GrantSummary, error)
- func (c *PlatformClient) GetRuntimePolicy(ctx context.Context, namespace, server string) ([]byte, error)
- func (c *PlatformClient) GetSession(ctx context.Context, namespace, name string) (sentinelaccess.SessionSummary, error)
- func (c *PlatformClient) GetTeam(ctx context.Context, slug string) (Team, error)
- func (c *PlatformClient) IssueAdapterCertificate(ctx context.Context, req AdapterCertificateRequest) (AdapterCertificate, error)
- func (c *PlatformClient) ListAgents(ctx context.Context, teamSlug, status, query, cursor string, limit int) (AgentPage, error)
- func (c *PlatformClient) ListGrants(ctx context.Context, namespace string) ([]sentinelaccess.GrantSummary, error)
- func (c *PlatformClient) ListNamespaces(ctx context.Context) ([]namespaceListItem, error)
- func (c *PlatformClient) ListRuntimeServers(ctx context.Context, namespace string) ([]ServerListItem, error)
- func (c *PlatformClient) ListRuntimeTools(ctx context.Context, filters map[string]string) ([]RuntimeToolRow, error)
- func (c *PlatformClient) ListSessions(ctx context.Context, namespace string) ([]sentinelaccess.SessionSummary, error)
- func (c *PlatformClient) ListTeamMembers(ctx context.Context, slug string) ([]TeamMembership, error)
- func (c *PlatformClient) ListTeams(ctx context.Context) ([]Team, error)
- func (c *PlatformClient) PatchGrant(ctx context.Context, namespace, name string, disabled bool) error
- func (c *PlatformClient) PatchSession(ctx context.Context, namespace, name string, revoked bool) error
- func (c *PlatformClient) PushRegistryImage(ctx context.Context, tarPath, target, scope string) error
- func (c *PlatformClient) RecordImagePublish(ctx context.Context, record ImagePublishRecord) error
- func (c *PlatformClient) RenameAgent(ctx context.Context, id, name string) (Agent, error)
- func (c *PlatformClient) RevokeGrantSessions(ctx context.Context, namespace, name string) (int, error)
- func (c *PlatformClient) SetAgentActive(ctx context.Context, id string, active bool) (Agent, error)
- func (c *PlatformClient) UpsertTeamMember(ctx context.Context, slug, userID, role string) (TeamMembership, error)
- func (c *PlatformClient) ValidateCredentials(ctx context.Context) error
- type PlatformUser
- type Principal
- type RuntimeToolRow
- type ServerListItem
- type Team
- type TeamMembership
- type ToolConfig
Constants ¶
const PlatformAuthRequiredMessage = "" /* 234-byte string literal not displayed */
PlatformAuthRequiredMessage tells users how to use the platform-backed CLI path.
Variables ¶
This section is empty.
Functions ¶
func AuthRequiredError ¶
AuthRequiredError wraps platform credential errors with user-facing mode guidance.
func HasPlatformClient ¶
func HasPlatformClient() bool
func NormalizeBaseURL ¶
NormalizeBaseURL trims whitespace, trailing slashes, and an optional trailing /api suffix from a platform base URL.
Types ¶
type AdapterCertificate ¶
type AdapterSession ¶
type AdapterSession struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
HumanID string `json:"humanID"`
AgentID string `json:"agentID"`
TeamID string `json:"teamID,omitempty"`
ServerName string `json:"serverName"`
ConsentedTrust string `json:"consentedTrust"`
PolicyVersion string `json:"policyVersion"`
ExpiresAt time.Time `json:"expiresAt"`
Reused bool `json:"reused"`
TrustDomain string `json:"trustDomain,omitempty"`
}
AdapterSession captures the identity the adapter must inject into runtime requests. ExpiresAt is absolute (server-side time); callers should refresh before it elapses.
type AdapterSessionRequest ¶
type AdapterSessionRequest struct {
ServerName string `json:"serverName"`
Namespace string `json:"namespace,omitempty"`
AgentID string `json:"agentID"`
RequestedTrust string `json:"requestedTrust,omitempty"`
RequestedTTL string `json:"requestedTTL,omitempty"`
}
AdapterSessionRequest is the input contract for the platform API endpoint POST /api/v1/runtime/adapter/sessions. RequestedTTL/Trust are optional; empty values fall back to platform-side defaults.
type ImagePublishRecord ¶
type PlatformClient ¶
type PlatformClient struct {
// contains filtered or unexported fields
}
PlatformClient calls the platform API with an API key.
func NewPlatformClient ¶
func NewPlatformClient() (*PlatformClient, error)
NewPlatformClient returns a client when platform credentials and API base URL are configured. If the user is not logged in, returns authfile.ErrNotFound.
func ResolvePlatformOrKube ¶
func ResolvePlatformOrKube(useKube bool) (*PlatformClient, bool, error)
ResolvePlatformOrKube returns direct Kubernetes mode only when useKube is explicit. Otherwise it requires platform API credentials and does not fall back to kubeconfig.
func (*PlatformClient) ApplyAccessFromYAMLFile ¶
func (c *PlatformClient) ApplyAccessFromYAMLFile(ctx context.Context, path string) error
func (*PlatformClient) ApplyRuntimeServer ¶
func (c *PlatformClient) ApplyRuntimeServer(ctx context.Context, name, namespace string, spec mcpv1alpha1.MCPServerSpec) (ServerListItem, error)
func (*PlatformClient) ApplyRuntimeServerWithScope ¶
func (c *PlatformClient) ApplyRuntimeServerWithScope(ctx context.Context, name, namespace, scope string, spec mcpv1alpha1.MCPServerSpec) (ServerListItem, error)
func (*PlatformClient) ApplyRuntimeServerWithScopeUpdate ¶
func (c *PlatformClient) ApplyRuntimeServerWithScopeUpdate(ctx context.Context, name, namespace, scope string, spec mcpv1alpha1.MCPServerSpec, update bool) (ServerListItem, error)
func (*PlatformClient) CreateAdapterSession ¶
func (c *PlatformClient) CreateAdapterSession(ctx context.Context, req AdapterSessionRequest) (AdapterSession, error)
CreateAdapterSession asks the platform to issue (or reuse) an MCPAgentSession for the calling principal. The returned session.Name doubles as the SessionID the adapter forwards on every runtime request.
func (*PlatformClient) CreateAgent ¶
func (*PlatformClient) CreateTeam ¶
func (*PlatformClient) CreateTeamUser ¶
func (c *PlatformClient) CreateTeamUser(ctx context.Context, slug, email, password, role string) (TeamMembership, error)
func (*PlatformClient) CreateUser ¶
func (c *PlatformClient) CreateUser(ctx context.Context, email, password, role string) (PlatformUser, error)
func (*PlatformClient) CurrentPrincipal ¶
func (c *PlatformClient) CurrentPrincipal(ctx context.Context) (Principal, error)
func (*PlatformClient) DeleteGrant ¶
func (c *PlatformClient) DeleteGrant(ctx context.Context, namespace, name string) error
func (*PlatformClient) DeleteRuntimeServer ¶
func (c *PlatformClient) DeleteRuntimeServer(ctx context.Context, namespace, name string) error
func (*PlatformClient) DeleteSession ¶
func (c *PlatformClient) DeleteSession(ctx context.Context, namespace, name string) error
func (*PlatformClient) GetGrant ¶
func (c *PlatformClient) GetGrant(ctx context.Context, namespace, name string) (sentinelaccess.GrantSummary, error)
func (*PlatformClient) GetRuntimePolicy ¶
func (*PlatformClient) GetSession ¶
func (c *PlatformClient) GetSession(ctx context.Context, namespace, name string) (sentinelaccess.SessionSummary, error)
func (*PlatformClient) IssueAdapterCertificate ¶
func (c *PlatformClient) IssueAdapterCertificate(ctx context.Context, req AdapterCertificateRequest) (AdapterCertificate, error)
func (*PlatformClient) ListAgents ¶
func (*PlatformClient) ListGrants ¶
func (c *PlatformClient) ListGrants(ctx context.Context, namespace string) ([]sentinelaccess.GrantSummary, error)
func (*PlatformClient) ListNamespaces ¶
func (c *PlatformClient) ListNamespaces(ctx context.Context) ([]namespaceListItem, error)
func (*PlatformClient) ListRuntimeServers ¶
func (c *PlatformClient) ListRuntimeServers(ctx context.Context, namespace string) ([]ServerListItem, error)
func (*PlatformClient) ListRuntimeTools ¶
func (c *PlatformClient) ListRuntimeTools(ctx context.Context, filters map[string]string) ([]RuntimeToolRow, error)
func (*PlatformClient) ListSessions ¶
func (c *PlatformClient) ListSessions(ctx context.Context, namespace string) ([]sentinelaccess.SessionSummary, error)
func (*PlatformClient) ListTeamMembers ¶
func (c *PlatformClient) ListTeamMembers(ctx context.Context, slug string) ([]TeamMembership, error)
func (*PlatformClient) ListTeams ¶
func (c *PlatformClient) ListTeams(ctx context.Context) ([]Team, error)
func (*PlatformClient) PatchGrant ¶
func (*PlatformClient) PatchSession ¶
func (*PlatformClient) PushRegistryImage ¶
func (c *PlatformClient) PushRegistryImage(ctx context.Context, tarPath, target, scope string) error
PushRegistryImage uploads a docker save tar and asks the platform API to push it to the configured registry from inside the cluster.
func (*PlatformClient) RecordImagePublish ¶
func (c *PlatformClient) RecordImagePublish(ctx context.Context, record ImagePublishRecord) error
func (*PlatformClient) RenameAgent ¶
func (*PlatformClient) RevokeGrantSessions ¶
func (*PlatformClient) SetAgentActive ¶
func (*PlatformClient) UpsertTeamMember ¶
func (c *PlatformClient) UpsertTeamMember(ctx context.Context, slug, userID, role string) (TeamMembership, error)
func (*PlatformClient) ValidateCredentials ¶
func (c *PlatformClient) ValidateCredentials(ctx context.Context) error
type PlatformUser ¶
type RuntimeToolRow ¶
type RuntimeToolRow struct {
ToolName string `json:"tool_name"`
Description string `json:"description,omitempty"`
ServerName string `json:"server_name"`
Namespace string `json:"namespace"`
TeamID string `json:"team_id,omitempty"`
EndpointURL string `json:"endpoint_url,omitempty"`
Declared bool `json:"declared"`
Live bool `json:"live"`
DriftStatus string `json:"drift_status"`
RequiredTrust string `json:"required_trust,omitempty"`
SideEffect string `json:"side_effect,omitempty"`
RiskLevel string `json:"risk_level,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
ConnectConfig map[string]any `json:"connect_config,omitempty"`
}
type ServerListItem ¶
type ServerListItem struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
TeamID string `json:"team_id,omitempty"`
Image string `json:"image,omitempty"`
ImageTag string `json:"imageTag,omitempty"`
Description string `json:"description,omitempty"`
Ready string `json:"ready"`
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Age string `json:"age"`
Endpoint string `json:"endpoint,omitempty"`
Tools []ToolConfig `json:"tools,omitempty"`
AccessJSON map[string]any `json:"access_json,omitempty"`
}
ServerListItem is one row from the platform API runtime servers list.
type TeamMembership ¶
type TeamMembership = platform.TeamMembership
type ToolConfig ¶
type ToolConfig struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
RequiredTrust string `json:"requiredTrust,omitempty"`
SideEffect string `json:"sideEffect,omitempty"`
RiskLevel string `json:"riskLevel,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}