Versions in this module Expand all Collapse all v6 v6.9.3 Mar 25, 2026 Changes in this version + const AuthURL + const ClientID + const LoginSuccessHtml + const RedirectURI + const SetupNoticeHtml + const TokenURL + 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 + func NewAnthropicHttpClient(cfg *config.SDKConfig) *http.Client + type AuthenticationError struct + Cause error + Code int + Message string + Type string + func NewAuthenticationError(baseErr *AuthenticationError, cause error) *AuthenticationError + func (e *AuthenticationError) Error() string + type ClaudeAuth struct + func NewClaudeAuth(cfg *config.Config) *ClaudeAuth + func (o *ClaudeAuth) CreateTokenStorage(bundle *ClaudeAuthBundle) *ClaudeTokenStorage + func (o *ClaudeAuth) ExchangeCodeForTokens(ctx context.Context, code, state string, pkceCodes *PKCECodes) (*ClaudeAuthBundle, error) + func (o *ClaudeAuth) GenerateAuthURL(state string, pkceCodes *PKCECodes) (string, string, error) + func (o *ClaudeAuth) RefreshTokens(ctx context.Context, refreshToken string) (*ClaudeTokenData, error) + func (o *ClaudeAuth) RefreshTokensWithRetry(ctx context.Context, refreshToken string, maxRetries int) (*ClaudeTokenData, error) + func (o *ClaudeAuth) UpdateTokenStorage(storage *ClaudeTokenStorage, tokenData *ClaudeTokenData) + type ClaudeAuthBundle struct + APIKey string + LastRefresh string + TokenData ClaudeTokenData + type ClaudeTokenData struct + AccessToken string + Email string + Expire string + RefreshToken string + type ClaudeTokenStorage struct + AccessToken string + Email string + Expire string + IDToken string + LastRefresh string + Metadata map[string]any + RefreshToken string + Type string + func (ts *ClaudeTokenStorage) SaveTokenToFile(authFilePath string) error + func (ts *ClaudeTokenStorage) SetMetadata(meta map[string]any) + 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 PKCECodes struct + CodeChallenge string + CodeVerifier string + func GeneratePKCECodes() (*PKCECodes, error) v6.9.2-rc1 Mar 25, 2026