auth

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginCommand

func LoginCommand() *cobra.Command

func Token

func Token(ctx context.Context) (string, error)

Token returns a valid access token as per current log-in state. Refresh is performed if necessary.

Types

type Config

type Config struct {
	OAuth        OAuthProviderConfig `mapstructure:"oauth" yaml:"oauth"`
	Expiry       int64               `mapstructure:"expiry" yaml:"expiry"`
	AccessToken  string              `mapstructure:"access_token" yaml:"access_token"`
	RefreshToken string              `mapstructure:"refresh_token" yaml:"refresh_token"`
}

func LoadConfig

func LoadConfig() (*Config, error)

type OAuthEndpoint

type OAuthEndpoint struct {
	AuthURL  string `mapstructure:"auth_url" yaml:"auth_url"`
	TokenURL string `mapstructure:"token_url" yaml:"token_url"`
}

type OAuthProviderConfig

type OAuthProviderConfig struct {
	Audience     string        `mapstructure:"audience" yaml:"audience"`
	Endpoint     OAuthEndpoint `mapstructure:"endpoint" yaml:"endpoint"`
	ClientID     string        `mapstructure:"client_id" yaml:"client_id"`
	ClientSecret string        `mapstructure:"client_secret" yaml:"client_secret"`
}

Jump to

Keyboard shortcuts

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