auth

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Token

func Token(formValues url.Values) (*TokenResponse, *TokenError, error)

Types

type AuthStrategy

type AuthStrategy interface {
	Authenticate(req *http.Request, clientId string, clientSecret string) error
}

type DeviceLinkingChallenge

type DeviceLinkingChallenge struct {
	DeviceCode              string `json:"deviceCode"`
	UserCode                string `json:"userCode"`
	VerificationUri         string `json:"verificationUri"`
	VerificationUriComplete string `json:"verificationUriComplete"`
	ExpiresIn               int    `json:"expiresIn"`
	Interval                int    `json:"interval"`
}

func RequestDeviceLinkingChallenge

func RequestDeviceLinkingChallenge(clientId string) (*DeviceLinkingChallenge, error)

type OpenAPIClientAuthStrategy

type OpenAPIClientAuthStrategy struct {
	// contains filtered or unexported fields
}

func NewOpenAPIClientAuthStrategy

func NewOpenAPIClientAuthStrategy() *OpenAPIClientAuthStrategy

func (*OpenAPIClientAuthStrategy) Authenticate

func (s *OpenAPIClientAuthStrategy) Authenticate(req *http.Request, clientID, clientSecret string) error

func (*OpenAPIClientAuthStrategy) GetToken

func (s *OpenAPIClientAuthStrategy) GetToken(clientID, clientSecret string) (string, error)

type TokenAuthStrategy

type TokenAuthStrategy struct {
	// contains filtered or unexported fields
}

func NewTokenAuthStrategy

func NewTokenAuthStrategy(token string) *TokenAuthStrategy

func (*TokenAuthStrategy) Authenticate

func (s *TokenAuthStrategy) Authenticate(req *http.Request, clientID, clientSecret string) error

type TokenError

type TokenError struct {
	Status           int    `json:"status"`
	Error            string `json:"error"`
	SubStatus        int    `json:"sub_status"`
	ErrorDescription string `json:"error_description"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	ClientName   string `json:"clientName"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
	User         struct {
		ID    int    `json:"id"`
		Email string `json:"email"`
	} `json:"user"`
	UserID int `json:"user_id"`
}

func PollDeviceLinkingStatus

func PollDeviceLinkingStatus(ctx context.Context, clientId string, clientSecret string, deviceCode string, interval int) (*TokenResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL