Documentation
¶
Index ¶
- Constants
- func CredentialsPath() (string, error)
- func Delete(provider string) error
- func Save(session Session) error
- type OpenAICodexEndpoints
- type OpenAICodexOptions
- type Session
- func Load(provider string) (Session, bool, error)
- func LoginOpenAICodexBrowser(ctx context.Context, opts OpenAICodexOptions) (Session, error)
- func LoginOpenAICodexDevice(ctx context.Context, opts OpenAICodexOptions) (Session, error)
- func RefreshOpenAICodex(ctx context.Context, opts OpenAICodexOptions, refreshToken string) (Session, error)
- func SessionStatus(provider string) (Session, string, bool, error)
Constants ¶
View Source
const ( OpenAICodexClientID = "app_EMoamEEZ73f0CkXaXp7hrann" OpenAICodexDefaultAuthURL = "https://auth.openai.com/oauth/authorize" OpenAICodexDefaultExchangeURL = "https://auth.openai.com/oauth/token" OpenAICodexDefaultDeviceUserCodeURL = "https://auth.openai.com/api/accounts/deviceauth/usercode" OpenAICodexDefaultDeviceExchangeURL = "https://auth.openai.com/api/accounts/deviceauth/token" OpenAICodexDefaultDeviceVerification = "https://auth.openai.com/codex/device" OpenAICodexDefaultDeviceCallback = "https://auth.openai.com/deviceauth/callback" OpenAICodexDefaultCallbackPort = 1455 )
Variables ¶
This section is empty.
Functions ¶
func CredentialsPath ¶
Types ¶
type OpenAICodexEndpoints ¶
type OpenAICodexEndpoints struct {
AuthURL string
TokenURL string
DeviceUserCodeURL string
DeviceTokenURL string
DeviceVerifyURL string
DeviceCallbackURI string
}
func DefaultOpenAICodexEndpoints ¶
func DefaultOpenAICodexEndpoints() OpenAICodexEndpoints
type OpenAICodexOptions ¶
type Session ¶
type Session struct {
Provider string `json:"provider,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
RefreshToken string `json:"refreshToken,omitempty"`
ExpiresAt time.Time `json:"expiresAt,omitempty"`
AccountEmail string `json:"accountEmail,omitempty"`
AccountID string `json:"accountId,omitempty"`
IDToken string `json:"idToken,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
func LoginOpenAICodexBrowser ¶
func LoginOpenAICodexBrowser(ctx context.Context, opts OpenAICodexOptions) (Session, error)
func LoginOpenAICodexDevice ¶
func LoginOpenAICodexDevice(ctx context.Context, opts OpenAICodexOptions) (Session, error)
func RefreshOpenAICodex ¶
Click to show internal directories.
Click to hide internal directories.