Documentation
¶
Index ¶
- Constants
- Variables
- func CheckInternalToken(configured, presented string) error
- func CheckPassword(hash, password string) bool
- func EnsureSSOConfigured(cfg *kernel.Config, auth *platform.AuthService) error
- func HashAPIKey(raw string) string
- func HashPassword(password string) (string, error)
- func IssueToken(secret string, ttl time.Duration, userID, email, role string) (string, error)
- func KeyPrefix(raw string) string
- func NewAuthService(cfg *kernel.Config, users identity.UserRepository, ...) *platform.AuthService
- func NewSSOStateStore(cfg *kernel.Config, rdb *goredis.Client) (identity.SSOStateStore, error)
- type A2AAgent
- type APIKey
- type Claims
- type Credential
- type CredentialAssignment
- type Environment
- type InviteOutcome
- type InvitePreview
- type MCPBackend
- type ModelPrice
- type ObjectStoreConfig
- type OrgInvite
- type OrgMember
- type Organization
- type Persistence
- type Project
- type ProtocolProbeResult
- type Provider
- type ProviderHealth
- type Quota
- type RequestPolicy
- type RetryConfig
- type Route
- type RouteFallback
- type Server
- type SigningKey
- type Team
- type TeamMember
- type UsageEvent
- type UsageFilter
- type UsageReportObserver
- type UsageSummaryBucket
- type User
- type WasmHook
Constants ¶
const ( OrgRoleOwner = tenancy.OrgRoleOwner OrgRoleAdmin = tenancy.OrgRoleAdmin OrgRoleMember = tenancy.OrgRoleMember TeamRoleOwner = tenancy.TeamRoleOwner TeamRoleAdmin = tenancy.TeamRoleAdmin TeamRoleMember = tenancy.TeamRoleMember InviteStatusPending = tenancy.InviteStatusPending )
Variables ¶
Functions ¶
func CheckInternalToken ¶
CheckInternalToken validates X-AFI-Internal-Token for HTTP admin endpoints. An empty configured token rejects all callers (fail closed).
func CheckPassword ¶
func EnsureSSOConfigured ¶
func EnsureSSOConfigured(cfg *kernel.Config, auth *platform.AuthService) error
EnsureSSOConfigured returns an error when SSO is enabled but no providers loaded.
func HashAPIKey ¶
func HashPassword ¶
func IssueToken ¶
func NewAuthService ¶
func NewAuthService( cfg *kernel.Config, users identity.UserRepository, identities identity.ExternalIdentityRepository, resets identity.PasswordResetRepository, states identity.SSOStateStore, ) *platform.AuthService
NewAuthService wires password + SSO auth against identity ports (composition root supplies adapters).
func NewSSOStateStore ¶
NewSSOStateStore builds the CSRF state backend for SSO. Prefer redis for horizontally scaled control planes; memory is for local/tests only.
Types ¶
type A2AAgent ¶
type A2AAgent = gatewayconfig.A2AAgent
type Claims ¶
func ParseToken ¶
type Credential ¶
type Credential = credentials.Credential
type CredentialAssignment ¶
type CredentialAssignment = credentials.Assignment
type Environment ¶
type Environment = tenancy.Environment
type InviteOutcome ¶
type InviteOutcome = tenancy.InviteOutcome
type InvitePreview ¶
type InvitePreview = tenancy.InvitePreview
type MCPBackend ¶
type MCPBackend = gatewayconfig.MCPBackend
type ModelPrice ¶
type ModelPrice = usage.ModelPrice
type ObjectStoreConfig ¶
type ObjectStoreConfig = gatewayconfig.ObjectStoreConfig
type Organization ¶
type Organization = tenancy.Organization
type Persistence ¶
Persistence is the control-plane DB facade (implemented by adapters/postgres.Store).
type ProtocolProbeResult ¶
type ProtocolProbeResult struct {
OK bool `json:"ok"`
StatusCode int `json:"status_code,omitempty"`
LatencyMs int64 `json:"latency_ms"`
Error string `json:"error,omitempty"`
Detail string `json:"detail,omitempty"`
}
ProtocolProbeResult is returned by MCP/A2A connection tests.
type Provider ¶
type Provider = gatewayconfig.Provider
type ProviderHealth ¶
type ProviderHealth = usage.ProviderHealth
type Quota ¶
type Quota = gatewayconfig.Quota
type RequestPolicy ¶
type RequestPolicy = gatewayconfig.RequestPolicy
type RetryConfig ¶
type RetryConfig = gatewayconfig.RetryConfig
type Route ¶
type Route = gatewayconfig.Route
type RouteFallback ¶
type RouteFallback = gatewayconfig.RouteFallback
type Server ¶
type Server struct {
Metrics *telemetry.ControlPlaneMetrics
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( cfg *kernel.Config, store Persistence, seeder localSeeder, publisher snapshotPublisher, snapStore snapshot.Store, log *slog.Logger, eventOutbox platform.EventEnqueuer, auditStore audit.Store, auth *platform.AuthService, ) *Server
NewServer wires HTTP delivery. Persistence/auth/audit adapters are injected by the composition root.
func (*Server) SetUsageEnqueuer ¶ added in v0.3.0
func (s *Server) SetUsageEnqueuer(u usageEnqueuer)
SetUsageEnqueuer configures spoke usage ingest (optional).
type SigningKey ¶ added in v0.3.0
type SigningKey = access.SigningKey
type TeamMember ¶
type TeamMember = tenancy.TeamMember
type UsageEvent ¶
type UsageFilter ¶
type UsageReportObserver ¶ added in v0.3.0
type UsageReportObserver struct {
Log *slog.Logger
Metrics *telemetry.ControlPlaneMetrics
}
UsageReportObserver accepts spoke/regional usage reports for observation only. It does not write usage_events or usage_outbox — durable analytics stay regional or are exported via OTel from these counters/logs.
func NewUsageReportObserver ¶ added in v0.3.0
func NewUsageReportObserver(log *slog.Logger) *UsageReportObserver
type UsageSummaryBucket ¶
type UsageSummaryBucket = usage.SummaryBucket
type WasmHook ¶
type WasmHook = gatewayconfig.WasmHook
Source Files
¶
- auth.go
- auth_service.go
- events.go
- federation_readonly.go
- http.go
- http_a2a_agents.go
- http_audit.go
- http_auth.go
- http_credentials.go
- http_environments.go
- http_federation.go
- http_keys.go
- http_mail.go
- http_mcp_backends.go
- http_middleware.go
- http_model_catalog.go
- http_object_store.go
- http_org_retry.go
- http_orgs.go
- http_policies.go
- http_projects.go
- http_provider_types.go
- http_providers.go
- http_quotas.go
- http_regions.go
- http_routes.go
- http_signing_keys.go
- http_teams.go
- http_usage.go
- http_wasm_hooks.go
- ids.go
- interfaces.go
- internal_token.go
- keys.go
- mail_resolve.go
- observe.go
- protocol_probe.go
- types.go
- usage_federation.go
- usage_report.go