auth

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTrialLicense = errors.New("no trial license found")
	ErrTrialExpired   = errors.New("trial license has expired")
)

Functions

func AddCredential

func AddCredential(cred Credential, allowOverwrite bool) error

func DefaultOauthClientID

func DefaultOauthClientID() string

func DefaultOauthURI

func DefaultOauthURI() string

func FetchColumnarLicense

func FetchColumnarLicense(cred *Credential) error

func GetCredPathForTesting

func GetCredPathForTesting() string

GetCredPathForTesting returns the current credential path

func IsColumnarPrivateRegistry

func IsColumnarPrivateRegistry(u *url.URL) bool

func LoadCredentials

func LoadCredentials() error

func PurgeCredentials

func PurgeCredentials() error

func RemoveCredential

func RemoveCredential(host Uri) error

func ResetCredentialsForTesting

func ResetCredentialsForTesting()

ResetCredentialsForTesting resets the loaded credentials state for testing

func SetCredPathForTesting

func SetCredPathForTesting(path string) (restore func())

SetCredPathForTesting sets the credential path for testing purposes

func UpdateCreds

func UpdateCreds() error

Types

type Credential

type Credential struct {
	Type         Type   `toml:"type"`
	AuthURI      Uri    `toml:"auth_uri"`
	RegistryURL  Uri    `toml:"registry_url"`
	ApiKey       string `toml:"api_key,omitempty"`
	Token        string `toml:"token"`
	RefreshToken string `toml:"refresh_token,omitempty"`
	ClientID     string `toml:"client_id,omitempty"`
	Audience     string `toml:"audience,omitempty"`
}

func GetCredentials

func GetCredentials(u *url.URL) (*Credential, error)

func (*Credential) GetAuthToken

func (t *Credential) GetAuthToken() string

func (*Credential) Refresh

func (t *Credential) Refresh() bool

type OpenIDConfig

type OpenIDConfig struct {
	Issuer                            Uri      `json:"issuer"`
	AuthorizationEndpoint             Uri      `json:"authorization_endpoint"`
	TokenEndpoint                     Uri      `json:"token_endpoint"`
	DeviceAuthorizationEndpoint       Uri      `json:"device_authorization_endpoint"`
	UserinfoEndpoint                  Uri      `json:"userinfo_endpoint"`
	JwksURI                           Uri      `json:"jwks_uri"`
	ScopesSupported                   []string `json:"scopes_supported"`
	ResponseTypesSupported            []string `json:"response_types_supported"`
	SubjectTypesSupported             []string `json:"subject_types_supported"`
	IDTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported"`
	ClaimsSupported                   []string `json:"claims_supported"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
	EndSessionEndpoint                Uri      `json:"end_session_endpoint"`
	RequestURIParameterSupported      bool     `json:"request_uri_parameter_supported"`
	RequestParameterSupported         bool     `json:"request_parameter_supported"`
}

func GetOpenIDConfig

func GetOpenIDConfig(issuer *url.URL) (config OpenIDConfig, err error)

type Type

type Type string
const (
	TypeApiKey Type = "apikey"
	TypeToken  Type = "oauth"
)

func (*Type) UnmarshalText

func (a *Type) UnmarshalText(text []byte) error

type Uri

type Uri url.URL

func (*Uri) MarshalText

func (u *Uri) MarshalText() ([]byte, error)

func (*Uri) String

func (u *Uri) String() string

func (*Uri) UnmarshalText

func (u *Uri) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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