Documentation
¶
Overview ¶
Package hyper provides functions to handle Hyper device flow authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeToken ¶
ExchangeToken exchanges a refresh token for an access token.
Types ¶
type DeviceAuthResponse ¶
type DeviceAuthResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURL string `json:"verification_url"`
ExpiresIn int `json:"expires_in"`
}
DeviceAuthResponse contains the response from the device authorization endpoint.
func InitiateDeviceAuth ¶
func InitiateDeviceAuth(ctx context.Context) (*DeviceAuthResponse, error)
InitiateDeviceAuth calls the /device/auth endpoint to start the device flow.
type IntrospectTokenResponse ¶
type IntrospectTokenResponse struct {
Active bool `json:"active"`
Sub string `json:"sub,omitempty"`
OrgID string `json:"org_id,omitempty"`
Exp int64 `json:"exp,omitempty"`
Iat int64 `json:"iat,omitempty"`
Iss string `json:"iss,omitempty"`
Jti string `json:"jti,omitempty"`
}
IntrospectTokenResponse contains the response from the token introspection endpoint.
func IntrospectToken ¶
func IntrospectToken(ctx context.Context, accessToken string) (*IntrospectTokenResponse, error)
IntrospectToken validates an access token using the introspection endpoint. Implements OAuth2 Token Introspection (RFC 7662).
type TokenResponse ¶
type TokenResponse struct {
RefreshToken string `json:"refresh_token,omitempty"`
UserID string `json:"user_id"`
OrganizationID string `json:"organization_id"`
OrganizationName string `json:"organization_name"`
Error string `json:"error,omitempty"`
ErrorDescription string `json:"error_description,omitempty"`
}
TokenResponse contains the response from the polling endpoint.
Click to show internal directories.
Click to hide internal directories.