feat(providers): general ?layout=flat setting to resolve at the store root#183
Draft
ojhermann wants to merge 1 commit into
Draft
feat(providers): general ?layout=flat setting to resolve at the store root#183ojhermann wants to merge 1 commit into
ojhermann wants to merge 1 commit into
Conversation
… root
Maps SecretSpec's {project}/{profile}/{key} convention onto the store root:
the secret is addressed by key alone, dropping the secretspec/{project}/{profile}
scaffolding but keeping any provider-native container (a Vault mount) or user
prefix (an AWS ?prefix=, an Infisical ?path=). The default nested layout is
unchanged.
Honored by every hierarchical provider -- Infisical, Vault, AWS Secrets Manager,
Google Cloud Secret Manager and Azure Key Vault. Providers with no hierarchy
(dotenv, env, bws) are already flat and ignore it.
Layout is a shared, per-provider-instance setting: parsed once through a strict
ProviderUrl::layout() (nested/flat, unknown value errors), then honored by each
provider's convention_address in its own dialect, so it works correctly in
fallback chains. Flat addresses by key alone, so project/profile aren't
validated; where the backend constrains names the key must fit, and Azure Key
Vault -- which uses the key verbatim -- refuses an underscore the nested layout
would have Base32-encoded away. Dropping the profile gives up profile
separation unless the provider pins its environment another way (an Infisical
?env=); flat plus such a pin collapses every profile onto one key deliberately.
Resolves cachix#181.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ojhermann
force-pushed
the
feat/infisical-flat-layout
branch
from
July 20, 2026 21:11
d070f6e to
56bae9a
Compare
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.
Resolves #181. This started as an Infisical-only
?layout=flat(raised by @nickdichev migrating from BWS); per @domenkozar's suggestion it is now a general provider setting, since the namespaced-vs-root question is the same for every hierarchical backend.What this adds
?layout=flatmaps SecretSpec's{project}/{profile}/{key}convention onto the store root — the secret is addressed by key alone, dropping thesecretspec/{project}/{profile}scaffolding but keeping any provider-native container (a Vault mount) or user prefix (an AWS?prefix=, an Infisical?path=). The default nested layout is unchanged, so existing configs behave exactly as before.Honored by Infisical, Vault, AWS Secrets Manager, Google Cloud Secret Manager, and Azure Key Vault. Providers with no hierarchy (
dotenv,env,bws) are already flat and ignore it.Design
ProviderUrl::layout()(strict:nested/flat; an unknown value errors, like?tls=). Each provider'sconvention_addressthen honors it in its own dialect. Layout is per-provider-instance, so it works correctly in per-secret fallback chains (a flat provider alongside a nested one).?env=) still keeps them apart, but flat plus a pinned env collapses every profile onto one key — a deliberate, documented "you're giving up profile separation" mode.Still open — your steer, @domenkozar
?layout=flat/nested.Tests & docs
Per-provider unit tests (no HTTP mocks): flat addressing, unconstrained project/profile names, key-still-validated, URI round-trip, unknown-layout rejected. Full crate suite green;
fmt/clippyclean. Docs updated across the providers reference (a general Layout section) and each provider page, labeled0.17+.🤖 Generated with Claude Code