// Package token owns everything about where a Vault token lives between // runs: resolving one from flag/env/config/disk, validating it, keeping it // renewed, and writing it back out — including in a form the real Vault CLI // can read (see store_vaultcli.go). package token import "context" // Store persists a single token value. Implementations must not log the // token value anywhere. type Store interface { // Kind identifies the implementation for display: "vault-cli", "profile", // or "none". Kind() string // Location is a display string: the token file path, or the external // helper binary path. Location() string Get(ctx context.Context) (string, error) Store(ctx context.Context, token string) error Erase(ctx context.Context) error } // noneStore never persists anything; used when token.storage: none. type noneStore struct{} func NewNoneStore() Store { return noneStore{} } func (noneStore) Kind() string { return "none" } func (noneStore) Location() string { return "" } func (noneStore) Get(context.Context) (string, error) { return "", nil } func (noneStore) Store(context.Context, string) error { return nil } func (noneStore) Erase(context.Context) error { return nil }