Documentation
¶
Index ¶
- Constants
- func AuthPath() string
- func ExtractAccountID(token string) string
- func FetchOAuthAuthorizationCode(ctx context.Context, authURL, redirectURL string, openBrowser BrowserOpener) (string, string, error)
- func GenerateState() (string, error)
- func OpenDefaultBrowser(rawURL string) error
- type BrowserOpener
- type OAuthCredential
- type OAuthLoginSession
- type OAuthManager
- func (m *OAuthManager) AuthorizationURL(challenge, state string) string
- func (m *OAuthManager) HasCredential(provider string) bool
- func (m *OAuthManager) Login(ctx context.Context, provider string) error
- func (m *OAuthManager) StartLogin(ctx context.Context, provider string) (*OAuthLoginSession, error)
- func (m *OAuthManager) ValidAccessToken(ctx context.Context, provider string) (OAuthCredential, error)
- type PKCE
- type Store
Constants ¶
View Source
const (
OpenAICodexProviderID = "openai-codex"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractAccountID ¶
func GenerateState ¶
func OpenDefaultBrowser ¶
Types ¶
type BrowserOpener ¶
type OAuthCredential ¶
type OAuthLoginSession ¶
type OAuthLoginSession struct {
AuthURL string
// contains filtered or unexported fields
}
type OAuthManager ¶
type OAuthManager struct {
Store *Store
HTTPClient *http.Client
OpenBrowser BrowserOpener
Issuer string
ClientID string
RedirectURI string
// contains filtered or unexported fields
}
func NewOAuthManager ¶
func NewOAuthManager(store *Store) *OAuthManager
func (*OAuthManager) AuthorizationURL ¶
func (m *OAuthManager) AuthorizationURL(challenge, state string) string
func (*OAuthManager) HasCredential ¶
func (m *OAuthManager) HasCredential(provider string) bool
func (*OAuthManager) Login ¶
func (m *OAuthManager) Login(ctx context.Context, provider string) error
func (*OAuthManager) StartLogin ¶
func (m *OAuthManager) StartLogin(ctx context.Context, provider string) (*OAuthLoginSession, error)
func (*OAuthManager) ValidAccessToken ¶
func (m *OAuthManager) ValidAccessToken(ctx context.Context, provider string) (OAuthCredential, error)
type PKCE ¶
func GeneratePKCE ¶
Click to show internal directories.
Click to hide internal directories.