auth

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCodexAccountIDFromJWT

func ParseCodexAccountIDFromJWT(token string) string

func ResolveToken

func ResolveToken(opts ResolveOptions) (string, error)

Types

type CodexCredential

type CodexCredential struct {
	AccessToken  string
	RefreshToken string
	AccountID    string
	Source       CodexCredentialSource
	SourcePath   string
}

func RefreshCodexCredential

func RefreshCodexCredential(ctx context.Context, cred CodexCredential, opts CodexRefreshOptions) (CodexCredential, error)

func ResolveCodexCredential

func ResolveCodexCredential(opts CodexResolveOptions) (CodexCredential, error)

type CodexCredentialSource

type CodexCredentialSource string
const (
	CodexCredentialSourceEnv  CodexCredentialSource = "env"
	CodexCredentialSourceFile CodexCredentialSource = "file"
)

type CodexRefreshOptions

type CodexRefreshOptions struct {
	TokenURL    string
	HTTPClient  *http.Client
	PersistFile bool
}

type CodexResolveOptions

type CodexResolveOptions struct {
	CodexHome string
}

type CredentialSource added in v0.6.0

type CredentialSource = CodexCredentialSource
const (
	CredentialSourceEnv  CredentialSource = CodexCredentialSourceEnv
	CredentialSourceFile CredentialSource = CodexCredentialSourceFile
)

type ProviderAuthConfig added in v0.6.0

type ProviderAuthConfig struct {
	Provider      string
	AuthMode      string
	OAuthProvider string
	APIKey        string
	CodexHome     string
}

type ProviderCredential added in v0.6.0

type ProviderCredential = CodexCredential

func RefreshProviderCredential added in v0.6.0

func RefreshProviderCredential(
	ctx context.Context,
	config ProviderAuthConfig,
	cred ProviderCredential,
	opts ProviderRefreshOptions,
) (ProviderCredential, error)

func ResolveProviderCredential added in v0.6.0

func ResolveProviderCredential(config ProviderAuthConfig) (ProviderCredential, error)

type ProviderRefreshOptions added in v0.6.0

type ProviderRefreshOptions struct {
	TokenURL      string
	HTTPClient    *http.Client
	PersistSource bool
}

type ResolveOptions

type ResolveOptions struct {
	Provider      string
	AuthMode      string
	OAuthProvider string
	APIKey        string
}

Jump to

Keyboard shortcuts

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