Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) AddTenant(tenant Tenant) error
- func (c *Config) GetTenant(tenantName string) (Tenant, error)
- func (c *Config) Initialize() error
- func (c *Config) IsLoggedInWithTenant(tenantName string) bool
- func (c *Config) ListAllTenants() ([]Tenant, error)
- func (c *Config) RemoveTenant(tenant string) error
- func (c *Config) SetDefaultAppIDForTenant(tenantName, appID string) error
- func (c *Config) SetDefaultTenant(tenantName string) error
- func (c *Config) Validate() error
- type ErrTokenMissingRequiredScopes
- type Tenant
- func (t *Tenant) CheckAuthenticationStatus() error
- func (t *Tenant) GetAccessToken() string
- func (t *Tenant) GetExtraRequestedScopes() []string
- func (t *Tenant) GetMissingRequiredScopes() []string
- func (t *Tenant) HasExpiredToken() bool
- func (t *Tenant) IsAuthenticatedWithClientCredentials() bool
- func (t *Tenant) IsAuthenticatedWithDeviceCodeFlow() bool
- func (t *Tenant) RegenerateAccessToken(ctx context.Context) error
- type Tenants
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidToken is thrown when the token is invalid. ErrInvalidToken = errors.New("token is invalid") // ErrMalformedToken indicates a corrupted JWT token was found in keyring. ErrMalformedToken = errors.New("corrupted authentication token detected") )
var ErrConfigFileMissing = errors.New("config.json file is missing")
ErrConfigFileMissing is thrown when the config.json file is missing.
var ErrNoAuthenticatedTenants = errors.New("not logged in. Try `auth0 login`")
ErrNoAuthenticatedTenants is thrown when the config file has no authenticated tenants.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
InstallID string `json:"install_id,omitempty"`
DefaultTenant string `json:"default_tenant"`
Tenants Tenants `json:"tenants"`
// contains filtered or unexported fields
}
Config holds cli configuration settings.
func (*Config) AddTenant ¶
AddTenant adds a tenant to the config. This is called after a login has completed.
func (*Config) Initialize ¶
Initialize will load the config settings into memory.
func (*Config) IsLoggedInWithTenant ¶
IsLoggedInWithTenant checks if we're logged in with the given tenant.
func (*Config) ListAllTenants ¶
ListAllTenants retrieves a list with all configured tenants.
func (*Config) RemoveTenant ¶
RemoveTenant removes a tenant from the config. This is called after a logout has completed.
func (*Config) SetDefaultAppIDForTenant ¶
SetDefaultAppIDForTenant saves the new default app id for the tenant to the disk.
func (*Config) SetDefaultTenant ¶
SetDefaultTenant saves the new default tenant to the disk.
type ErrTokenMissingRequiredScopes ¶
type ErrTokenMissingRequiredScopes struct {
MissingScopes []string
}
func (ErrTokenMissingRequiredScopes) Error ¶ added in v1.17.0
func (e ErrTokenMissingRequiredScopes) Error() string
type Tenant ¶
type Tenant struct {
Name string `json:"name"`
Domain string `json:"domain"`
AccessToken string `json:"access_token,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
DefaultAppID string `json:"default_app_id,omitempty"`
ClientID string `json:"client_id"`
}
Tenant keeps track of auth0 config for the tenant.
func (*Tenant) CheckAuthenticationStatus ¶
CheckAuthenticationStatus checks to see if the tenant in the config has all the required scopes and that the access token is not expired.
func (*Tenant) GetAccessToken ¶
GetAccessToken retrieves the tenant's access token.
func (*Tenant) GetExtraRequestedScopes ¶
GetExtraRequestedScopes retrieves any extra scopes requested for the tenant when logging in through the device code flow.
func (*Tenant) GetMissingRequiredScopes ¶ added in v1.20.1
GetMissingRequiredScopes returns a slice of required scopes that are missing from the tenant's current scopes.
func (*Tenant) HasExpiredToken ¶
HasExpiredToken checks whether the tenant has an expired token.
func (*Tenant) IsAuthenticatedWithClientCredentials ¶
IsAuthenticatedWithClientCredentials checks to see if the tenant has been authenticated through client credentials.
func (*Tenant) IsAuthenticatedWithDeviceCodeFlow ¶
IsAuthenticatedWithDeviceCodeFlow checks to see if the tenant has been authenticated through device code flow.