Documentation
¶
Overview ¶
Package secretmapping is the fleet's one typed JSON-secret field-mapping — so no integration adapter (ServiceNow, ESO, a UI rotator) forks its own "pull these fields out of the secret JSON" logic. A Mapping declares which JSON keys of a secret map to canonical credential fields (username, password, private key, passphrase, …), with per-secret-path overrides.
It is a pure, generic field-mapping primitive: it models any JSON secret and names no particular project. The mapping itself is the public shape; the concrete per-secret mapping values a deployment uses are its own data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field string
Field is a canonical credential field name an integration consumes. New fields are additive.
type FieldMap ¶
FieldMap maps a canonical Field to the JSON key in the secret that supplies it. E.g. {Username: "user", Password: "pass"} reads secret["user"] into the canonical "username" slot.
type Mapping ¶
type Mapping struct {
// Default maps canonical fields to JSON keys for all secrets.
Default FieldMap
// Overrides maps a secret path to a FieldMap that replaces the Default for
// that path (per-field: an override entry shadows the default entry).
Overrides map[string]FieldMap
}
Mapping is a typed JSON-secret field-mapping with per-secret overrides. The Default map applies to every secret; Overrides keyed by secret path replace the default for that path. The zero value (no default, no overrides) is valid but maps nothing; build it through New.
func (*Mapping) Apply ¶
Apply reads the raw JSON secret bytes and projects them onto the canonical fields, using the mapping for the given secret path. It returns a map keyed by canonical Field. A canonical field whose mapped JSON key is absent from the secret is omitted from the result (not an error) — so callers can detect missing optional fields.
type Option ¶
type Option func(*Mapping)
Option configures a Mapping.
func WithOverride ¶
WithOverride sets a per-secret-path override field map. Override entries shadow the corresponding default entries for that path.