Versions in this module Expand all Collapse all v1 v1.0.3 Jul 29, 2026 v1.0.2 Jul 28, 2026 Changes in this version + const ClientID + const CodeChallengeMethodS256 + const DefaultScopes + const ErrCodeInvalidClient + const ErrCodeInvalidGrant + const ErrCodeInvalidRequest + const ErrCodeInvalidScope + const ErrCodeInvalidSession + const ErrCodeSessionExpired + const ErrCodeUnauthorizedClient + const ErrCodeUnsupportedGrant + const RevealEnabled + var ErrInvalidSession = errors.New("session is no longer valid, run: tabstack auth login") + var ErrNoSession = errors.New("not signed in, run: tabstack auth login") + var ErrSessionExpired = errors.New("session expired, run: tabstack auth login") + func Challenge(verifier string) string + func IsInvalidGrant(err error) bool + func NewState() (string, error) + func NewVerifier() (string, error) + func Scopes() string + type APIError struct + Code string + Message string + StatusCode int + func (e *APIError) Error() string + type APIKey struct + APIKey string + ID string + LastUsedAt *time.Time + Name string + OrganizationID string + Preview string + type AuthorizeParams struct + Challenge string + OrgID string + RedirectURI string + Scope string + State string + type Client struct + func New(authURL string, opts ...Option) *Client + func (c *Client) AttachSession(store config.CredentialStore, cfg *config.Config) *SessionManager + func (c *Client) AuthURL() string + func (c *Client) AuthorizeURL(p AuthorizeParams) string + func (c *Client) CreateAPIKey(ctx context.Context, orgID, name string) (*APIKey, error) + func (c *Client) ExchangeCode(ctx context.Context, code, verifier, redirectURI string) (*TokenResponse, error) + func (c *Client) ListAPIKeys(ctx context.Context, orgID string) ([]APIKey, error) + func (c *Client) Logout(ctx context.Context) error + func (c *Client) Me(ctx context.Context) (*Me, error) + func (c *Client) Organizations(ctx context.Context) ([]Org, error) + func (c *Client) Refresh(ctx context.Context, refreshToken string) (*TokenResponse, error) + func (c *Client) RevealAPIKey(ctx context.Context, keyID string) (*APIKey, error) + func (c *Client) RevokeAPIKey(ctx context.Context, keyID string) error + func (c *Client) RevokeAllSessions(ctx context.Context) error + func (c *Client) RevokeSession(ctx context.Context, id string) error + func (c *Client) Session() *SessionManager + func (c *Client) Sessions(ctx context.Context) ([]SessionInfo, error) + type Me struct + DefaultOrg string + Organizations []Org + Session struct{ ... } + User struct{ ... } + type OAuthError struct + Code string + Description string + StatusCode int + func (e *OAuthError) Error() string + type Option func(*Client) + func WithHTTPClient(h *http.Client) Option + type Org struct + ID string + Name string + Role string + type RefreshFunc func(ctx context.Context, refreshToken string) (*TokenResponse, error) + type SessionInfo struct + CreatedAt *time.Time + Current bool + ExpiresAt *time.Time + ID string + Label string + LastUsedAt *time.Time + type SessionManager struct + func NewSessionManager(refresh RefreshFunc, store config.CredentialStore, cfg *config.Config) *SessionManager + func (m *SessionManager) Clear() error + func (m *SessionManager) Config() *config.Config + func (m *SessionManager) Establish(tok *TokenResponse, email string) error + func (m *SessionManager) ForceRefresh(ctx context.Context) (string, error) + func (m *SessionManager) SetEmail(email string) + func (m *SessionManager) Token(ctx context.Context) (string, error) + type TokenResponse struct + AccessToken string + ExpiresIn int + RefreshToken string + Scope string + TokenType string