cloud_auth

package
v1.23.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient interface {
	CreateDeviceAuth() (*DeviceAuthResponse, error)
	ExchangeToken(TokenRequest) (*TokenResponse, error)
}

func NewCloudAuthClient

func NewCloudAuthClient(
	environment types.CloudEnvironment,
	log logging.Logger,
	timeout time.Duration) APIClient

type CloudAuthClient

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

func (CloudAuthClient) CreateDeviceAuth

func (c CloudAuthClient) CreateDeviceAuth() (*DeviceAuthResponse, error)

func (CloudAuthClient) ExchangeToken

func (c CloudAuthClient) ExchangeToken(request TokenRequest) (*TokenResponse, error)

type CloudAuthClientFactory added in v1.19.0

type CloudAuthClientFactory func(environment types.CloudEnvironment, log logging.Logger, timeout time.Duration) APIClient

type DeviceAuthRequest

type DeviceAuthRequest struct {
	Scope string `json:"scope"`
}

type DeviceAuthResponse

type DeviceAuthResponse struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int    `json:"expires_in"`
	Interval                int    `json:"interval"`
}

type MockClient

type MockClient struct {
	mock.Mock
}

func NewMockClient

func NewMockClient() *MockClient

func (*MockClient) CreateDeviceAuth

func (m *MockClient) CreateDeviceAuth() (*DeviceAuthResponse, error)

func (*MockClient) ExchangeToken

func (m *MockClient) ExchangeToken(request TokenRequest) (*TokenResponse, error)

type TokenRequest

type TokenRequest struct {
	GrantType    string `json:"grant_type"`
	DeviceCode   string `json:"device_code"`
	RefreshToken string `json:"refresh_token"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken  types.CloudAuthToken `json:"access_token"`
	RefreshToken string               `json:"refresh_token"`
	ExpiresIn    int                  `json:"expires_in"`
	TokenType    string               `json:"token_type"`
	Scope        string               `json:"scope"`
}

Jump to

Keyboard shortcuts

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