clauderunner

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package clauderunner verifies identities issued to Claude self-hosted sessions.

Index

Constants

View Source
const (
	ClaudeTagAccount = "claude-tag"
)

ClaudeTagAccount identifies accountless service sessions within an environment.

Variables

This section is empty.

Functions

func AccessDenied

func AccessDenied(err error) bool

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

func ManageOrchestrators(ctx context.Context, gateway *client.Client, obotURL string) func()

ManageOrchestrators refreshes database-backed environments on every replica. ponytail: polling every five seconds; add notifications if the environment count warrants it.

func NormalizeAccountID

func NormalizeAccountID(value string) (string, error)

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 ValidateEgressHosts(hosts []string) error

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"`
}

func (*Claims) Owner

func (c *Claims) Owner() (string, error)

Owner distinguishes service identities explicitly; a missing account alone is never sufficient to authorize a Claude Tag session.

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.

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func (*Verifier) Verify

func (v *Verifier) Verify(ctx context.Context, raw, pool, org string) (*Claims, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL