fix(credential): extract resolve() from dfe-fetcher into shared module#42
Open
kazmosahebi wants to merge 4 commits into
Open
fix(credential): extract resolve() from dfe-fetcher into shared module#42kazmosahebi wants to merge 4 commits into
resolve() from dfe-fetcher into shared module#42kazmosahebi wants to merge 4 commits into
Conversation
added 4 commits
May 27, 2026 12:26
Adds a new `credential` feature with `resolve` / `resolve_optional` / `CredentialError`, supporting `env:VAR`, `vault:path:key`, and literal specs. Vault arm is gated behind the existing `secrets` feature; when off, `vault:` returns `CredentialError::VaultUnsupported` cleanly. Closes #40.
Addresses code-review feedback: - include `credential` in the `full` aggregator alongside other optional modules - restore prior-art's more specific vault error messages - correct the test comment about parallel-test safety
5f86db8 to
79e08ae
Compare
resolve() from dfe-fetcher into shared moduleresolve() from dfe-fetcher into shared module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vault:path:key,env:VAR, literal) into a newcredentialCargo feature so downstream services (loader, future services) can share the same syntax.src/credential.rs:resolve/resolve_optional/CredentialError(typed enum:MissingEnvVar { name },Vault,BadSpec,VaultUnsupported).credential = []is opt-in; thevault:arm is additionally gated on the existingsecretsfeature, so consumers that don't enablesecretsget a cleanVaultUnsupportederror rather than silent failure.credentialadded to thefullaggregator so it ships with the everything-enabled build.Closes #40.
Behaviour
secretsonsecretsoffenv:FOO(set)env:FOO(unset)MissingEnvVar { name: "FOO" }MissingEnvVar { name: "FOO" }vault:path:key(reachable)secrets::SecretsManagerVaultUnsupportedDownstream consumers (separate PRs)
Test plan
cargo test --no-default-features --features credential --lib credential::tests→ 6/6cargo test --no-default-features --features credential,secrets --lib credential::tests→ 5/5 (vault-without-feature test is#[cfg(not(feature = "secrets"))]-gated)cargo clippy --no-default-features --features credential -- -D warningsclean