Skip to content

CompiledMatcher

Functions

  • rewrite - Extract secrets from output and return it rewritten with placeholders.

firma_secret_provider::matcher::CompiledMatcher::rewrite

Section titled “firma_secret_provider::matcher::CompiledMatcher::rewrite”

Function

Extract secrets from output and return it rewritten with placeholders.

mint(name, value, domains, item) -> placeholder is invoked once per extracted secret:

  • name: field label (always present).
  • value: plaintext secret.
  • domains: hostname scopes when domain_selector is configured, else empty. A secret may legitimately be scoped to more than one host (e.g. a domain_selector matching several URLs on the same vault item), so all of them are passed through; an empty set means the secret is unscoped and resolves for any host.
  • item: item title when item_selector is configured, else None.

The caller mints and stores the placeholder → value mapping and returns the placeholder to substitute in place of the value.

Returns [MatcherError] if the output does not match the matcher’s shape (bad JSON / UTF-8, non-string or misaligned nodes) or re-serialization fails.

fn rewrite<impl FnMut(String, SecretString, HashSet<Authority>, Option<String>) -> SecretPlaceholder>(self: &Self, output: &[u8], mint: & mut impl Trait) -> Result<Vec<u8>, MatcherError>