Documentation
¶
Overview ¶
Package secret resolves secret references of the form <scheme>://<ref> against pluggable sources — the seam that lets mcpcli pull credentials from Bitwarden Secrets Manager (bws://) today and other secret managers later. A Resolver is built per run with its sources handed in explicitly (no init, no global registry): adding a manager means one new package implementing Source plus one registration line at the cli wiring site.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver dispatches secret references to registered sources. Build one per run with New; a Resolver is immutable after construction and holds nothing but its source map.
func New ¶
New returns a Resolver dispatching to the given sources. Schemes are lowercased at insert and deduped on the lowered form, so two sources claiming the same scheme in any case spelling fail construction. An empty Scheme is not special-cased and simply dedupes like any other value.
func (*Resolver) Expand ¶
Expand resolves value when its scheme matches a registered source — the scheme is lowercased before lookup (RFC 3986: schemes are case-insensitive, so "BWS://name" reaches the "bws" source) and the source receives whatever follows the first "://". Anything else passes through unchanged. Expansion is single-pass: a resolved value is never re-scanned, so a decrypted secret whose VALUE is itself a registered ref comes back as-is instead of looping (self or mutual refs).
func (*Resolver) Recognizes ¶
Recognizes reports whether value looks like a reference this Resolver would expand: its scheme — lowercased, same rule as Expand — matches a registered source. It performs no resolution (no network, no side effects), so callers can classify values without paying for a fetch.