Documentation
¶
Index ¶
- func Authenticate(ctx context.Context, ...) (*oauth2.Token, error)
- func CheckTokenExpiry(token *oauth2.Token) error
- func ClearTokens() error
- func ClearWorkspace() error
- func LoadToken(provider string) (*oauth2.Token, error)
- func OpenBrowser(url string) error
- func SaveToken(token *oauth2.Token, provider string) error
- func SaveWorkspace(workspace WorkspaceInfo) error
- func SelectTenant(tenants []string) (string, error)
- type AuthError
- type AuthResult
- type Client
- type ErrorCode
- type Token
- type TokenInfo
- type WorkspaceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func CheckTokenExpiry ¶ added in v0.2.1
func ClearWorkspace ¶ added in v0.13.0
func ClearWorkspace() error
ClearWorkspace removes the stored workspace
func OpenBrowser ¶
func SaveWorkspace ¶ added in v0.13.0
func SaveWorkspace(workspace WorkspaceInfo) error
SaveWorkspace saves the selected workspace to disk
func SelectTenant ¶ added in v0.15.0
SelectTenant prompts the user to select a tenant from a list
Types ¶
type AuthError ¶
AuthError represents authentication-related errors
func NewAuthError ¶
func NewAuthErrorWithCause ¶
type AuthResult ¶
type TokenInfo ¶
type TokenInfo struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token,omitempty"`
IDToken string `json:"id_token,omitempty"`
TokenType string `json:"token_type"`
ExpiresAt time.Time `json:"expires_at"`
ExpiresIn int64 `json:"expires_in,omitempty"`
Scopes []string `json:"scopes"`
Provider string `json:"provider"`
}
type WorkspaceInfo ¶ added in v0.13.0
type WorkspaceInfo struct {
ID string `json:"id"`
Description string `json:"description"`
PlatformUrl string `json:"platformUrl"` // Track which platform this workspace belongs to
AuthEndpoint string `json:"authEndpoint"` // Track which auth endpoint this workspace belongs to
Tenant string `json:"tenant"` // The tenant name (e.g., "demo")
}
WorkspaceInfo stores the selected workspace details
func LoadWorkspace ¶ added in v0.13.0
func LoadWorkspace(currentPlatformUrl, currentAuthEndpoint string) (*WorkspaceInfo, error)
LoadWorkspace loads the selected workspace from disk and validates it matches the current platform and auth endpoint
func SelectWorkspace ¶ added in v0.13.0
func SelectWorkspace(workspaces []WorkspaceInfo) (*WorkspaceInfo, error)
SelectWorkspace prompts the user to select a workspace from a list
Click to show internal directories.
Click to hide internal directories.