contexttoken

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderName is the default HTTP header used by transaction tokens.
	HeaderName = transactiontoken.HeaderName

	// TTSTokenSourceNone disables Orka-initiated token exchanges.
	TTSTokenSourceNone = "none"
	// TTSTokenSourceServiceAccount uses Orka's ServiceAccount identity for exchanges.
	TTSTokenSourceServiceAccount = "serviceAccount"
	// TTSTokenSourceIncoming uses the incoming subject token for exchanges.
	TTSTokenSourceIncoming = "incoming"
)

Variables

This section is empty.

Functions

func SubjectTokenTypeForSource

func SubjectTokenTypeForSource(tokenSource string) string

SubjectTokenTypeForSource returns the default RFC 8693 subject token type for an Orka TTS token source.

Types

type ExchangeRequest

type ExchangeRequest struct {
	SubjectToken     string
	SubjectTokenType string
	Scope            string
	RequestedTTL     time.Duration
	RequestDetails   map[string]any
	RequestContext   map[string]any
}

ExchangeRequest describes a TTS exchange or replacement request.

type Exchanger

type Exchanger interface {
	Exchange(ctx context.Context, req ExchangeRequest) (string, error)
}

Exchanger exchanges subject tokens for transaction tokens.

type TTSClient

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

TTSClient is a strict RFC 8693 transaction-token service client.

func NewTTSClient

func NewTTSClient(cfg TTSConfig) (*TTSClient, error)

NewTTSClient creates a TTS client for the configured exact endpoint.

func (*TTSClient) Exchange

func (c *TTSClient) Exchange(ctx context.Context, req ExchangeRequest) (token string, err error)

Exchange exchanges the subject token for a transaction token and requires the strict txn_token/N_A response profile.

type TTSConfig

type TTSConfig struct {
	Endpoint      string
	Audience      string
	Timeout       time.Duration
	TokenSource   string
	ChildTokenTTL time.Duration
	ToolTokenTTL  time.Duration
}

TTSConfig controls optional vendor-neutral transaction-token service integration.

func NewTTSConfig

func NewTTSConfig(endpoint, audience, timeout, tokenSource, childTTL, toolTTL string) (TTSConfig, error)

NewTTSConfig builds TTS integration config from flag/env values. Endpoint is the exact OAuth token endpoint; Orka never appends a provider-specific path.

func (TTSConfig) Enabled

func (c TTSConfig) Enabled() bool

Enabled reports whether Orka should perform TTS exchanges.

Jump to

Keyboard shortcuts

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