kctoken

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestFailed = errors.New("HTTP request failed")
	ErrNoAccessToken = errors.New("no access token in response")
)

Functions

This section is empty.

Types

type GetServiceTokenOption

type GetServiceTokenOption func(*GetServiceTokenOptions)

func WithCustomerID

func WithCustomerID(customerID string) GetServiceTokenOption

func WithTenantID

func WithTenantID(tenantID string) GetServiceTokenOption

type GetServiceTokenOptions

type GetServiceTokenOptions struct {
	TenantID   string
	CustomerID string
}

type KeycloakError

type KeycloakError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type TokenClient

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

func NewTokenClient

func NewTokenClient(url, clientID, clientSecret string, opts ...TokenClienttOption) *TokenClient

func (*TokenClient) GetServiceToken

func (client *TokenClient) GetServiceToken(ctx context.Context, opts ...GetServiceTokenOption) (string, error)

type TokenClienttOption

type TokenClienttOption func(*TokenClient)

func WithRestyClient

func WithRestyClient(restyClient *resty.Client) TokenClienttOption

func WithTimeout

func WithTimeout(timeout time.Duration) TokenClienttOption

type TokenResponse

type TokenResponse struct {
	AccessToken      string `json:"access_token"`
	ExpiresIn        int    `json:"expires_in"`
	RefreshExpiresIn int    `json:"refresh_expires_in"`
	TokenType        string `json:"token_type"`
	NotBeforePolicy  int    `json:"not-before-policy"`
	Scope            string `json:"scope"`
}

Jump to

Keyboard shortcuts

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