contexts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func Names

func Names() []string

Names returns the accepted context names in listing order.

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 All

func All() []Context

All returns every context in listing order.

func Lookup

func Lookup(name string) (Context, error)

Lookup returns the context called name.

func Resolve

func Resolve(flag, env, stored string) (Context, error)

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

func (c Context) APIBaseURL() string

APIBaseURL returns the gateway base with no trailing slash.

type Name

type Name string

Name is a context identifier accepted by -c and LFED_CONTEXT.

const (
	Dev     Name = "dev"
	Staging Name = "staging"
	Prod    Name = "prod"
)

The three contexts the lfed CLI knows.

Jump to

Keyboard shortcuts

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