Documentation
¶
Overview ¶
Package clauderunner verifies identities issued to Claude self-hosted sessions.
Index ¶
- Constants
- func AccessDenied(err error) bool
- func DefaultRuntime(runtime *types.ClaudeRuntime)
- func EffectiveResources(base, override types.ClaudeResources) types.ClaudeResources
- func EgressHostAllowed(runtime types.ClaudeRuntime, host string) bool
- func ManageOrchestrators(ctx context.Context, gateway *client.Client, obotURL string) func()
- func NormalizeAccountID(value string) (string, error)
- func SecretKey(secret types.ClaudeEgressSecret) string
- func StartOrchestrator(ctx context.Context, key, token, environment, obotURL string) (func(), error)
- func ValidateEgressHosts(hosts []string) error
- func ValidateResources(worker types.ClaudeWorker, r types.ClaudeResources) error
- func ValidateRuntime(runtime types.ClaudeRuntime) error
- func WithDefaultImages(runtime types.ClaudeRuntime, workerImage, runnerImage string) types.ClaudeRuntime
- type Claims
- type ResolvedEnvironment
- type Verifier
Constants ¶
const (
ClaudeTagAccount = "claude-tag"
)
ClaudeTagAccount identifies accountless service sessions within an environment.
Variables ¶
This section is empty.
Functions ¶
func AccessDenied ¶
func DefaultRuntime ¶
func DefaultRuntime(runtime *types.ClaudeRuntime)
DefaultRuntime fills an environment's unset settings before it is saved. Images are left unset, so the environment follows Obot's default images: see WithDefaultImages.
func EffectiveResources ¶
func EffectiveResources(base, override types.ClaudeResources) types.ClaudeResources
func EgressHostAllowed ¶
func EgressHostAllowed(runtime types.ClaudeRuntime, host string) bool
EgressHostAllowed uses Substrate's single-label wildcard matching.
func ManageOrchestrators ¶
ManageOrchestrators refreshes database-backed environments on every replica. ponytail: polling every five seconds; add notifications if the environment count warrants it.
func NormalizeAccountID ¶
NormalizeAccountID accepts the UUID saved by Claude Code login or the tagged ID used in work orders. Claude Code 2.1.289 encodes UUIDs as user_01 plus 22 base58 digits.
func SecretKey ¶
func SecretKey(secret types.ClaudeEgressSecret) string
func StartOrchestrator ¶
func StartOrchestrator(ctx context.Context, key, token, environment, obotURL string) (func(), error)
StartOrchestrator supervises Anthropic's CLI on every Obot replica. Anthropic claims work server-side; Obot's admission handler deduplicates retried orders.
func ValidateEgressHosts ¶
func ValidateResources ¶
func ValidateResources(worker types.ClaudeWorker, r types.ClaudeResources) error
func ValidateRuntime ¶
func ValidateRuntime(runtime types.ClaudeRuntime) error
ValidateRuntime validates the runtime an environment runs with, including its images.
func WithDefaultImages ¶ added in v0.28.0
func WithDefaultImages(runtime types.ClaudeRuntime, workerImage, runnerImage string) types.ClaudeRuntime
WithDefaultImages returns runtime with Obot's default worker and runner images in place of the ones it doesn't set. Only images an administrator sets are saved with an environment.
Types ¶
type Claims ¶
type Claims struct {
jwt.RegisteredClaims
Role string `json:"ccr:role"`
Pool string `json:"ccr:pool_id"`
Org string `json:"ccr:org_id"`
OrgUUID string `json:"organization_uuid"`
Account string `json:"ccr:account_id"`
Session string `json:"ccr:session_id"`
Actor struct {
Subject string `json:"sub"`
Email string `json:"email"`
} `json:"act"`
}
type ResolvedEnvironment ¶
type ResolvedEnvironment struct {
types.ClaudeEnvironment
MCPServerIDs []string
AllowClaudeMCP bool
}
func AuthorizedEnvironment ¶
func AuthorizedEnvironment(ctx context.Context, gateway *client.Client, environment, account, owner string) (*ResolvedEnvironment, error)
AuthorizedEnvironment rechecks the administrator-approved identity and current profile membership on admission, credential refresh, and reconciliation.
func ResolveEnvironment ¶
func ResolveEnvironment(user kuser.Info, env *types.ClaudeEnvironment) (*ResolvedEnvironment, error)
ResolveEnvironment combines matching profile grants and inherits unspecified resources.