Resolve ${connection:<key>.<prop>} sentinels in container env values - #198
Closed
willdavsmith wants to merge 1 commit into
Closed
Resolve ${connection:<key>.<prop>} sentinels in container env values#198willdavsmith wants to merge 1 commit into
willdavsmith wants to merge 1 commit into
Conversation
Add a connectionTokens table built from the same decrypted resourceConnections
(and the same exclusions) as connectionEnvVars, then resolve any
${connection:<key>.<prop>} sentinel found in a container env `value` to the
connected resource's real property value. Both top-level connection properties
and the nested `properties` bag are covered.
This lets an application reference a specific connected-resource property by name
in an env var — including a sensitive property delivered decrypted through
connection injection — without relying on the fixed CONNECTION_<KEY>_<PROP>
naming, and without a per-app startup shim or custom image.
Backward-compatible: env values that contain no sentinel pass through unchanged,
and secrets-resource connections / disableDefaultEnvVars are skipped exactly as
for the default connection env vars.
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
What
Teaches the Kubernetes
Radius.Compute/containersrecipe to resolve${connection:<key>.<prop>}sentinels placed in a container envvalue. A newconnectionTokenstable is built from the same decryptedresourceConnections(and the same exclusions) as the existingconnectionEnvVars, then each envvalueis passed through areduce(... replace ...)that substitutes any sentinel with the connected resource's real property value. Both top-level connection properties and the nestedpropertiesbag are covered.Why
Today an application can only receive connected-resource properties under the fixed
CONNECTION_<KEY>_<PROP>names. Apps that expect a specific env var name (e.g. a third-party image) otherwise need a per-app startup shim or a custom image to remap the value. The sentinel lets the app author name the target env var directly and pull any single property — including a sensitive property that is delivered decrypted through connection injection — with no shim and no custom image.Backward compatibility
disableDefaultEnvVarsare skipped exactly as for the default connection env vars.Dependency
The sensitive-value path relies on the connection being delivered decrypted at runtime, which comes from radius-project/radius#12286 (connection-injection decrypt +
x-radius-retain). Non-sensitive properties resolve on radiusmaintoday; sensitive ones require #12286. Marking this draft until #12286 lands.Verification
Proven end-to-end by a cloud-free kind-only test in
resource-types-verification: a synthetic connected resource exposes a non-sensitive canary and a sensitive (x-radius-sensitive+x-radius-retain) canary; a busybox container consumes both via sentinels. The resolved Deployment-spec env showed the plain canary and the sensitive canary delivered decrypted: