Documentation
¶
Overview ¶
Package contexts is the compiled-in table of deployment contexts.
A context names one Auth0 tenant and one education API gateway. The lfed CLI knows three: dev, staging, prod. Backend deployment suffixes MUST NOT appear here; a plugin that needs them owns that mapping.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoContext = errors.New("no context set; run `lfed context use <dev|staging|prod>`")
ErrNoContext is returned by Resolve when no source names a context.
Functions ¶
Types ¶
type Context ¶
type Context struct {
Name Name
// Auth0Domain is the host for /oauth/device/code and /oauth/token.
Auth0Domain string
// Issuer is the expected iss claim of access tokens.
Issuer string
// Audience is the API identifier requested at login. It ends with "/".
Audience string
// ClientID is the Auth0 native client for the device code grant.
ClientID string
}
Context is one row of the table.
func Resolve ¶
Resolve picks the context from the first non-empty source: the -c flag, LFED_CONTEXT, then the config file. It returns ErrNoContext when all are empty.
func (Context) APIBaseURL ¶
APIBaseURL returns the gateway base with no trailing slash.