Versions in this module Expand all Collapse all v5 v5.2.6 Sep 21, 2025 v5.2.5 Sep 20, 2025 v5.2.4 Sep 20, 2025 v5.2.3 Sep 19, 2025 v5.2.2 Sep 19, 2025 v5.2.1 Sep 19, 2025 v5.2.0 Sep 19, 2025 v5.1.29 Sep 17, 2025 v5.1.28 Sep 16, 2025 v5.1.27 Sep 15, 2025 v5.1.26 Sep 14, 2025 v5.1.25 Sep 13, 2025 Changes in this version + const LoginSuccessHtml + const SetupNoticeHtml + var ErrBrowserOpenFailed = &AuthenticationError + var ErrCallbackTimeout = &AuthenticationError + var ErrCodeExchangeFailed = &AuthenticationError + var ErrInvalidState = &AuthenticationError + var ErrPortInUse = &AuthenticationError + var ErrServerStartFailed = &AuthenticationError + func GetUserFriendlyMessage(err error) string + func IsAuthenticationError(err error) bool + func IsOAuthError(err error) bool + type AuthenticationError struct + Cause error + Code int + Message string + Type string + func NewAuthenticationError(baseErr *AuthenticationError, cause error) *AuthenticationError + func (e *AuthenticationError) Error() string + type CodexAuth struct + func NewCodexAuth(cfg *config.Config) *CodexAuth + func (o *CodexAuth) CreateTokenStorage(bundle *CodexAuthBundle) *CodexTokenStorage + func (o *CodexAuth) ExchangeCodeForTokens(ctx context.Context, code string, pkceCodes *PKCECodes) (*CodexAuthBundle, error) + func (o *CodexAuth) GenerateAuthURL(state string, pkceCodes *PKCECodes) (string, error) + func (o *CodexAuth) RefreshTokens(ctx context.Context, refreshToken string) (*CodexTokenData, error) + func (o *CodexAuth) RefreshTokensWithRetry(ctx context.Context, refreshToken string, maxRetries int) (*CodexTokenData, error) + func (o *CodexAuth) UpdateTokenStorage(storage *CodexTokenStorage, tokenData *CodexTokenData) + type CodexAuthBundle struct + APIKey string + LastRefresh string + TokenData CodexTokenData + type CodexAuthInfo struct + ChatgptAccountID string + ChatgptPlanType string + ChatgptSubscriptionActiveStart any + ChatgptSubscriptionActiveUntil any + ChatgptSubscriptionLastChecked time.Time + ChatgptUserID string + Groups []any + Organizations []Organizations + UserID string + type CodexTokenData struct + AccessToken string + AccountID string + Email string + Expire string + IDToken string + RefreshToken string + type CodexTokenStorage struct + AccessToken string + AccountID string + Email string + Expire string + IDToken string + LastRefresh string + RefreshToken string + Type string + func (ts *CodexTokenStorage) SaveTokenToFile(authFilePath string) error + type JWTClaims struct + AtHash string + Aud []string + AuthProvider string + AuthTime int + CodexAuthInfo CodexAuthInfo + Email string + EmailVerified bool + Exp int + Iat int + Iss string + Jti string + Rat int + Sid string + Sub string + func ParseJWTToken(token string) (*JWTClaims, error) + func (c *JWTClaims) GetAccountID() string + func (c *JWTClaims) GetUserEmail() string + type OAuthError struct + Code string + Description string + StatusCode int + URI string + func NewOAuthError(code, description string, statusCode int) *OAuthError + func (e *OAuthError) Error() string + type OAuthResult struct + Code string + Error string + State string + type OAuthServer struct + func NewOAuthServer(port int) *OAuthServer + func (s *OAuthServer) IsRunning() bool + func (s *OAuthServer) Start() error + func (s *OAuthServer) Stop(ctx context.Context) error + func (s *OAuthServer) WaitForCallback(timeout time.Duration) (*OAuthResult, error) + type Organizations struct + ID string + IsDefault bool + Role string + Title string + type PKCECodes struct + CodeChallenge string + CodeVerifier string + func GeneratePKCECodes() (*PKCECodes, error)