Repository navigation
Conversation
Allow provider aliases to use explicit {env:NAME} placeholders for non-secret native coordinates. Include expanded values in cache fingerprints so cached routes follow environment changes.
|
We're not going to support env vars in references. What's the use case / workflow you want to support? |
|
@domenkozar The use case is a committed manifest where part of a secret’s path is developer-specific and non-secret. We want to avoid generating local manifests or duplicating provider aliases. |
Could you expand on that? I'm not sure I understand the full motivation. Happy to help! |
|
Sure. Imagine each developer has their own credentials for a shared database: Allowing each developer to provide the identifier through their environment would make it possible to commit a shared spec such as: This avoids having to generate and maintain a local-only spec file for each developer. |
Okay so inside the secrets provider, each developer has a password who's item name depends on the developer username? |
|
After digging through provider resolution, global aliases already use the same I implemented that in #410: # secretspec.toml — 0.21+
[defaults]
providers = ["developer"]Each developer can then configure the alias globally: # ~/.config/secretspec/config.toml
[defaults.providers.developer]
uri = "awsps://developer@us-east-1"
ref = { item = "/{project}/{profile}/developers/alice/{key}" }Bob would use the same alias name with The resolution order remains This handles the motivating use case without |
|
Closing this one for now, as we won't be adding environment variables to templating, let's continue exploring best way to support your workflow! |
Summary
{env:NAME}placeholders to provider alias reference templatesMotivation
Provider coordinates sometimes include a non-secret namespace selected by the current developer, tenant, or runtime. Existing templates support
{project},{profile}, and{key}, but an environment-selected namespace otherwise requires generating a manifest or duplicating provider aliases.This adds an explicit environment placeholder without changing composed-secret semantics. Environment values are expanded once and remain opaque. Because native coordinates can appear in diagnostics and audit records, they must not contain secret values.
Review path
docs/src/content/docs/concepts/references.mdxdefines the public behavior and safety boundary.secretspec/src/config.rsvalidates and expands placeholders, with focused parser and runtime tests.secretspec/src/plan.rsfingerprints expanded coordinates so environment changes invalidate cached routes.Validation
devenv testdevenv shell cargo clippy --workspace --exclude secretspec-php-nativedevenv shell cargo fmt --all -- --checkdevenv shell npm --prefix docs run build