Documentation
¶
Index ¶
- Constants
- func HTTPErrorCode(err error) string
- func HTTPStatus(err error) (int, bool)
- func Retryable(err error) bool
- type CLIPoll
- type CLIStart
- type Claims
- type Client
- func (c Client) ListTeams(ctx context.Context, accessToken string) ([]Team, error)
- func (c Client) PollCLI(ctx context.Context, pollingCode string) (CLIPoll, error)
- func (c Client) Refresh(ctx context.Context, refreshToken string) (SessionTokens, error)
- func (c Client) SelectTeam(ctx context.Context, accessToken, teamID string) error
- func (c Client) SignOut(ctx context.Context, accessToken, refreshToken string) error
- func (c Client) StartCLI(ctx context.Context, expires time.Duration) (CLIStart, error)
- type HTTPError
- type PublicConfig
- type SessionTokens
- type Team
- type TenantExchange
- type Verifier
Constants ¶
View Source
const DefaultAPIURL = "https://api.stack-auth.com/api/v1"
Variables ¶
This section is empty.
Functions ¶
func HTTPErrorCode ¶ added in v0.1.62
HTTPErrorCode returns Stack's machine-readable error code, when present.
func HTTPStatus ¶ added in v0.1.62
HTTPStatus returns the response status carried by a Stack API error. Callers should use this instead of parsing Stack's human-readable response body, which is not a stable interface.
Types ¶
type CLIStart ¶
type CLIStart struct {
PollingCode string `json:"polling_code"`
LoginCode string `json:"login_code"`
ExpiresAt time.Time `json:"-"`
}
func (*CLIStart) UnmarshalJSON ¶
type Claims ¶
type Claims struct {
Subject string
ProjectID string
SelectedTeamID string
Email string
Role string
Issuer string
ExpiresAt time.Time
IsAnonymous bool
IsRestricted bool
}
func ParseClaimsUnverified ¶
ParseClaimsUnverified reads identity hints used to select the user's team in the CLI. The hosted service independently verifies the signature and every security-sensitive claim before issuing a tenant key.
type Client ¶
type Client struct {
APIURL string
ProjectID string
PublishableClientKey string
HTTPClient *http.Client
}
func (Client) SelectTeam ¶
type PublicConfig ¶
type PublicConfig struct {
Version int `json:"version"`
Auth struct {
APIURL string `json:"apiUrl"`
ProjectID string `json:"projectId"`
PublishableClientKey string `json:"publishableClientKey"`
ConfirmURL string `json:"confirmUrl"`
} `json:"auth"`
Subrouter struct {
URL string `json:"url"`
ExchangeURL string `json:"exchangeUrl"`
} `json:"subrouter"`
}
func FetchPublicConfig ¶
func (PublicConfig) Validate ¶
func (c PublicConfig) Validate() error
type SessionTokens ¶
type TenantExchange ¶
Click to show internal directories.
Click to hide internal directories.