Replace secretName with a secrets array on postgreSqlDatabases and mySqlDatabases - #193
Closed
willdavsmith wants to merge 3 commits into
Closed
Replace secretName with a secrets array on postgreSqlDatabases and mySqlDatabases#193willdavsmith wants to merge 3 commits into
willdavsmith wants to merge 3 commits into
Conversation
Mark the secretName property with x-radius-secret-reference so Radius resolves the referenced Radius.Security/secrets resource and injects its values into direct-module recipe parameters (context.resource.secrets.<key>), rather than passing the literal secret name to the recipe. Mirrors the existing x-radius-sensitive precedent on Radius.Security/secrets. Requires the engine support added in radius-project/radius#12254; the marker is inert on engine versions without it, so this stays draft until that lands. Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Replace the secretName string property with a secrets array marked x-radius-secret-binding. Each entry is a Radius.Security/secrets resource ID; Radius loads every key of each listed secret and exposes it to the recipe as context.resource.secrets.<secretName>.<key>, where <secretName> is the secret resource's name. This supersedes the earlier x-radius-secret-reference marker on secretName and lets direct-module recipes inject developer-authored secret values (admin username/password) into the provisioned database. Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Mirror the postgreSqlDatabases change: replace the single secretName string
property with a secrets array carrying x-radius-secret-binding, so MySQL
credentials are injected into the direct-module recipe via
{{context.resource.secrets.<secretName>.<key>}}. Lowercase the example secret
data keys (username/password) to match.
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Closed
5 tasks
Contributor
Author
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.
Description
Replaces the single
secretNamestring onRadius.Data/postgreSqlDatabasesandRadius.Data/mySqlDatabaseswith asecretsarray annotatedx-radius-secret-binding: true. Each entry is the resource ID of aRadius.Security/secretsresource (for exampledbSecret.id):The
mySqlDatabaseschange is identical in shape (samesecretsarray, same annotation, samerequiredupdate).Radius recognizes a property carrying this annotation as a list of secret bindings. For every listed secret it loads all of the secret's keys and exposes them to direct-module recipes as
{{context.resource.secrets.<secretName>.<key>}}, where<secretName>is the secret resource's name and<key>is a key in itsdata. Platform recipes therefore consume real credentials without the developer ever placing them in the app definition.Why an array of resource IDs instead of a single name string:
connections. Developers already reference other resources by.id; secrets now follow the same convention....secrets.<secretName>.<key>), so multiple bound secrets never clash.requiredis updated from[environment, secretName]to[environment, secrets]on both types. This is a metadata + schema-shape change to one existing property; the types' recipes are otherwise unchanged.Important
This depends on the engine support added in radius-project/radius#12254, which introduces the
x-radius-secret-bindingannotation and the{{context.resource.secrets.<secretName>.<key>}}resolution path. The annotation is inert on engine versions without it, so this PR stays a draft until #12254 lands. Design context: radius-project/radius#12244.Related GitHub Issue: N/A (tracked in radius-project/radius#12244 and #12254)
Testing
Exercised end-to-end by the manual resource-type verification workflow in
radius-project/resource-types-verification— the Azure (Bicep AVM) direct-module flow registers each manifest, deploys apostgreSqlDatabases/mySqlDatabasesresource whosesecretsarray points at aRadius.Security/secretsresource, and proves the injected secret value reaches the cloud database (the server'sadministratorLoginread-back matches the secret's username), then validates delete.Contributor Checklist
required: []for every object propertyreadOnly: true)Remaining checklist items (README docs, developer documentation, recipe authoring/idempotency,
rad resource-type show) are unchanged frommain— this PR only changes a single property's shape on two existing types.