Documentation
¶
Index ¶
- Variables
- func NewOAuth2Config(ctx context.Context, orgURL string, clientID string) (*oauth2.Config, error)
- type AuthorizationResponse
- func EnsureValidAuthData(ctx context.Context, auth *AuthorizationResponse, orgURL string, ...) (*AuthorizationResponse, error)
- func Login(ctx context.Context, orgURL string, clientID string) (AuthorizationResponse, error)
- func Refresh(ctx context.Context, config *oauth2.Config, refreshToken string) (*AuthorizationResponse, error)
- type ContextKeyAuthData
- type LoginResponse
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAuthTokenExpired = fmt.Errorf("authorization token expired")
Functions ¶
Types ¶
type AuthorizationResponse ¶
type AuthorizationResponse struct {
AccessToken string `json:"access_token"`
IDToken string `json:"id_token"`
Scope string `json:"scope"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
RefreshToken string `json:"refresh_token"`
ExpiresAt int64 `json:"expires_at"`
}
func EnsureValidAuthData ¶
func EnsureValidAuthData(ctx context.Context, auth *AuthorizationResponse, orgURL string, clientID string) (*AuthorizationResponse, error)
func (*AuthorizationResponse) GetExpiresAt ¶
func (a *AuthorizationResponse) GetExpiresAt() int64
func (AuthorizationResponse) IsExpired ¶
func (a AuthorizationResponse) IsExpired() bool
type ContextKeyAuthData ¶
type ContextKeyAuthData struct{}
type LoginResponse ¶
type LoginResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
VerificationURIComplete string `json:"verification_uri_complete"`
Message string `json:"message"`
}
type ServerConfig ¶
type ServerConfig struct {
Issuer string `json:"issuer"`
ClientID string `json:"client_ids"` // TODO: I think this can just be removed
RestrictedClientIDs []string `json:"restricted_client_ids"`
RestrictedClientAllowedEndpointsList []string `json:"restricted_endpoints"`
Audience string `json:"audience"`
JWKSURL string `json:"jwks_url"`
}
func (ServerConfig) IsValid ¶
func (s ServerConfig) IsValid() bool
Click to show internal directories.
Click to hide internal directories.