oauth

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopilotAvailableModelIDs

func CopilotAvailableModelIDs(credential *auth.Credential) ([]string, bool)

func GeneratePKCE

func GeneratePKCE(random io.Reader) (verifier, challenge string, err error)

func GitHubCopilotBaseURL

func GitHubCopilotBaseURL(token, enterpriseDomain string) string

func OAuthErrorHTML

func OAuthErrorHTML(message, details string) string

func OAuthSuccessHTML

func OAuthSuccessHTML(message string) string

func OpenAICodexAccountID

func OpenAICodexAccountID(token string) string

Types

type Anthropic

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

func NewAnthropic

func NewAnthropic(options *AnthropicOptions) *Anthropic

func (*Anthropic) Login

func (flow *Anthropic) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*Anthropic) Name

func (*Anthropic) Name() string

func (*Anthropic) Refresh

func (flow *Anthropic) Refresh(ctx context.Context, credential *auth.Credential) (*auth.Credential, error)

func (*Anthropic) ToAuth

func (*Anthropic) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type AnthropicOptions

type AnthropicOptions struct {
	AuthorizeURL string
	TokenURL     string
	CallbackHost string
	CallbackPort int
	RedirectURI  string
	HTTPClient   *http.Client
	Random       io.Reader
	Now          func() time.Time
	Listen       func(network, address string) (net.Listener, error)
}

type GitHubCopilot

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

func NewGitHubCopilot

func NewGitHubCopilot(options *GitHubCopilotOptions) *GitHubCopilot

func (*GitHubCopilot) Login

func (flow *GitHubCopilot) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*GitHubCopilot) Name

func (*GitHubCopilot) Name() string

func (*GitHubCopilot) Refresh

func (flow *GitHubCopilot) Refresh(ctx context.Context, credential *auth.Credential) (*auth.Credential, error)

func (*GitHubCopilot) ToAuth

func (*GitHubCopilot) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type GitHubCopilotOptions

type GitHubCopilotOptions struct {
	DeviceCodeURL   string
	AccessTokenURL  string
	CopilotTokenURL string
	CopilotBaseURL  string
	HTTPClient      *http.Client
	KnownModelIDs   []string
	Sleep           func(context.Context, time.Duration) error
}

type KimiCoding

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

func NewKimiCoding

func NewKimiCoding(options *KimiCodingOptions) *KimiCoding

func (*KimiCoding) Login

func (flow *KimiCoding) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*KimiCoding) LoginLabel

func (*KimiCoding) LoginLabel() string

func (*KimiCoding) Name

func (*KimiCoding) Name() string

func (*KimiCoding) Refresh

func (flow *KimiCoding) Refresh(ctx context.Context, credential *auth.Credential) (*auth.Credential, error)

func (*KimiCoding) ToAuth

func (*KimiCoding) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type KimiCodingOptions

type KimiCodingOptions struct {
	OAuthHost  string
	HTTPClient *http.Client
	Now        func() time.Time
	Sleep      func(context.Context, time.Duration) error
}

type OpenAICodex

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

func NewOpenAICodex

func NewOpenAICodex(options *OpenAICodexOptions) *OpenAICodex

func (*OpenAICodex) Login

func (flow *OpenAICodex) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*OpenAICodex) Name

func (*OpenAICodex) Name() string

func (*OpenAICodex) Refresh

func (flow *OpenAICodex) Refresh(ctx context.Context, credential *auth.Credential) (*auth.Credential, error)

func (*OpenAICodex) ToAuth

func (*OpenAICodex) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type OpenAICodexOptions

type OpenAICodexOptions struct {
	AuthorizeURL          string
	TokenURL              string
	DeviceUserCodeURL     string
	DeviceTokenURL        string
	DeviceVerificationURI string
	RedirectURI           string
	DeviceRedirectURI     string
	CallbackHost          string
	CallbackPort          int
	HTTPClient            *http.Client
	Random                io.Reader
	Now                   func() time.Time
	Listen                func(network, address string) (net.Listener, error)
}

type OpenRouter

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

func NewOpenRouter

func NewOpenRouter(options *OpenRouterOptions) *OpenRouter

func (*OpenRouter) Login

func (flow *OpenRouter) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*OpenRouter) LoginLabel

func (*OpenRouter) LoginLabel() string

func (*OpenRouter) Name

func (*OpenRouter) Name() string

func (*OpenRouter) Refresh

func (*OpenRouter) Refresh(_ context.Context, credential *auth.Credential) (*auth.Credential, error)

Refresh is a no-op: the OAuth flow mints a permanent API key.

func (*OpenRouter) ToAuth

func (*OpenRouter) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type OpenRouterOptions

type OpenRouterOptions struct {
	AuthorizeURL string
	TokenURL     string
	CallbackHost string
	LoginTimeout time.Duration
	HTTPClient   *http.Client
	Random       io.Reader
	Listen       func(network, address string) (net.Listener, error)
}

type XAI

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

func NewXAI

func NewXAI(options *XAIOptions) *XAI

func (*XAI) Login

func (flow *XAI) Login(ctx context.Context, interaction auth.AuthInteraction) (*auth.Credential, error)

func (*XAI) LoginLabel

func (*XAI) LoginLabel() string

func (*XAI) Name

func (*XAI) Name() string

func (*XAI) Refresh

func (flow *XAI) Refresh(ctx context.Context, credential *auth.Credential) (*auth.Credential, error)

func (*XAI) ToAuth

func (*XAI) ToAuth(credential *auth.Credential) (auth.ModelAuth, error)

type XAIOptions

type XAIOptions struct {
	DeviceCodeURL string
	TokenURL      string
	HTTPClient    *http.Client
	Now           func() time.Time
	Sleep         func(context.Context, time.Duration) error
}

Jump to

Keyboard shortcuts

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