Skip to content

Add SecretMarkingProvider for post-hoc secret marking #131

@gautamrajur

Description

@gautamrajur

I'd like to propose adding SecretMarkingProvider - a wrapper provider that marks configuration values as secrets based on key patterns.

Use case

When integrating with external configuration sources (environment variables, third-party providers) that don't properly identify sensitive data, users need a way to retroactively mark values as secrets.

Current workaround

Implement a custom provider wrapper manually, duplicating boilerplate code.

Proposed solution

A new SecretMarkingProvider<Upstream> wrapper that:

  • Wraps any existing ConfigProvider
  • Marks values as secrets when keys match a user-provided predicate
  • Preserves existing secret status (never removes isSecret flag)
let envProvider = EnvironmentVariablesProvider()
let secretMarkedProvider = envProvider.markSecrets { key in
    key.description.contains("password")
}

I have a working implementation and proposal (SCO-0004) ready for review.

Implementation branch: https://github.com/gautamrajur/swift-configuration/tree/feature/secret-marking-provider

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions