apple / apple/swift-configuration
Add SecretMarkingProvider for post-hoc secret marking
- Dominant language
- Swift
- Stars
- 812
- Forks
- 60
- Avg merge
- 9h 38m
- Merged PRs (30d)
- 6
Description
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` 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)
```swift
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
Contributor guide
Research direction
Review proposal SCO-0004 and the feature/secret-marking-provider branch first, since the issue says a working implementation already exists there. Check that the provider wraps any ConfigProvider, applies the user predicate to keys, and preserves existing secret status; done means the proposed API and behavior are ready for review.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100