authcmd

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 18 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scope added in v0.28.1

func Scope(env, ws string) string

Types

type Config

type Config struct {
	Argv          []string
	Dir           string
	Profile       Profile
	Format        Format
	Header        string
	Scheme        string
	TokenPath     string
	TypePath      string
	ExpiryPath    string
	ExpiresInPath string
	CacheKey      string
	TTL           time.Duration
	Timeout       time.Duration
}

func Finalize

func Finalize(cfg Config) (Config, error)

func Parse

func Parse(params map[string]string, src Source) (Config, error)

func (Config) HeaderName added in v0.25.2

func (cfg Config) HeaderName() string

func (Config) WithBaseTimeout

func (cfg Config) WithBaseTimeout(base time.Duration) Config

type Format

type Format string
const (
	FormatText Format = "text"
	FormatJSON Format = "json"
)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) Cached

func (m *Manager) Cached(env string, cfg Config) (Result, bool, error)

func (*Manager) CachedPrepared added in v0.25.2

func (m *Manager) CachedPrepared(prep Prepared) (Result, bool, error)

func (*Manager) Prepare added in v0.25.2

func (m *Manager) Prepare(env string, cfg Config) (Prepared, error)

func (*Manager) Resolve

func (m *Manager) Resolve(ctx context.Context, env string, cfg Config) (Result, error)

func (*Manager) ResolvePrepared added in v0.25.2

func (m *Manager) ResolvePrepared(ctx context.Context, prep Prepared) (Result, error)

func (*Manager) Restore added in v0.27.1

func (m *Manager) Restore(entries []SnapshotEntry)

func (*Manager) SetExecFunc

func (m *Manager) SetExecFunc(fn func(context.Context, Config) ([]byte, error))

func (*Manager) Snapshot added in v0.27.1

func (m *Manager) Snapshot() []SnapshotEntry

type Prepared added in v0.25.2

type Prepared struct {
	// contains filtered or unexported fields
}

func (Prepared) HeaderName added in v0.26.1

func (p Prepared) HeaderName() string

type Profile added in v1.10.0

type Profile struct {
	Path string
	Name string
}

Profile identifies a named auth definition and the file that contains it.

type Result

type Result struct {
	Header string
	Value  string
	Token  string
	Type   string
	Expiry time.Time
}

type SnapshotEntry added in v0.27.1

type SnapshotEntry struct {
	Key       string    `json:"key"`
	Config    Config    `json:"config"`
	Token     string    `json:"token"`
	Type      string    `json:"type,omitempty"`
	Expiry    time.Time `json:"expiry,omitempty"`
	FetchedAt time.Time `json:"fetchedAt,omitempty"`
}

type Source added in v1.10.0

type Source struct {
	Dir     string
	Profile Profile
}

Source is where a command auth is defined. The command runs in Dir.

Jump to

Keyboard shortcuts

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