utils

package
v0.0.0-...-05c9738 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PoolLabel                   = "agentland.fl0rencess720.app/pool"
	ProfileHashLabel            = "agentland.fl0rencess720.app/profile-hash"
	SandboxLabel                = "agentland.fl0rencess720.app/sandbox-name-hash"
	ClaimUIDLabel               = "agentland.fl0rencess720.app/claim-uid"
	PodNameAnnotation           = "agentland.fl0rencess720.app/pod-name"
	PoolBackfillTouchAnnotation = "agentland.fl0rencess720.app/pool-backfill-touch-at"
)
View Source
const (
	DefaultRequeueInterval  = 500 * time.Millisecond
	ConflictRequeueInterval = 100 * time.Millisecond
	FallbackRequeueInterval = 2 * time.Second
)

Variables

This section is empty.

Functions

func AddHashValueRequirement

func AddHashValueRequirement(selector labels.Selector, key, name string) (labels.Selector, error)

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

func NameHash

func NameHash(name string) string

func ParseBearerToken

func ParseBearerToken(headerValue string) (string, error)

func SelectorWithHashValue

func SelectorWithHashValue(key, name string) (labels.Selector, error)

Types

type Claims

type Claims struct {
	Issuer    string `json:"iss"`
	Audience  string `json:"aud"`
	SessionID string `json:"sid"`
	Subject   string `json:"sub,omitempty"`
	Version   int64  `json:"ver,omitempty"`
	IssuedAt  int64  `json:"iat"`
	NotBefore int64  `json:"nbf"`
	ExpiresAt int64  `json:"exp"`
	JWTID     string `json:"jti"`
}
type Header struct {
	Alg string `json:"alg"`
	Typ string `json:"typ"`
	KID string `json:"kid,omitempty"`
}

type Signer

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

func NewSignerFromConfig

func NewSignerFromConfig(cfg SignerConfig) (*Signer, error)

func (*Signer) Sign

func (s *Signer) Sign(sessionID, subject string, version int64) (string, error)

type SignerConfig

type SignerConfig struct {
	PrivateKeyPath string
	Issuer         string
	Audience       string
	KID            string
	TTL            time.Duration
}

type Verifier

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

func NewVerifierFromConfig

func NewVerifierFromConfig(cfg VerifierConfig) (*Verifier, error)

func (*Verifier) Verify

func (v *Verifier) Verify(token string) (*Claims, error)

type VerifierConfig

type VerifierConfig struct {
	PublicKeyPath string
	Issuer        string
	Audience      string
	ClockSkew     time.Duration
}

Jump to

Keyboard shortcuts

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