Commit cf57799
authored
Adopt the recipe secret-output pattern for secret-bearing resource types (#226)
## Summary
Adopts the recipe **secret-output** pattern for the seven secret-bearing
resource types, so their recipe-generated secrets are no longer stored
on the owning resource.
Today these types expose their secret (connection string / URL / API key
/ account key) as a **plain read-only property**, which is written onto
the resource and surfaced on reads, in logs, and in the application
graph. This PR moves each secret into a managed
`Radius.Security/secrets` resource and exposes only a read-only
reference on the owner.
## What changed (per type)
For **kafka, rabbitMQ, mongoDatabases, redisCaches, models, search,
objectStorage**:
- **Type schema (`<type>.yaml`)** — replace the plain secret property
with a single read-only `secrets` block: a reserved `name` sub-property
(the reference to the managed secret) plus the secret key(s). The block
is intentionally **not** marked `readOnly` (forward-compat for future
secret *inputs*); each sub-property's own `readOnly` flag is the
output/input discriminator. Descriptions updated to consume the secret
via `secretKeyRef`.
- **Recipe pack (`recipepack/azure/aks-recipepack.bicep`)** — nest the
secret module outputs under `outputs.secrets`. Also adds the
`objectStorage` `connectionString` mapping (declared on the type but
previously missing from the pack).
- **`test/app.bicep`** — bind the secret into a container env var via
`valueFrom.secretKeyRef` using `<resource>.properties.secrets.name`.
- **README** — reflect the `secrets` reference + `secretKeyRef`
consumption.
| Type | Secret key(s) | Non-secret (still connection-injected) |
|---|---|---|
| Messaging/kafka | `connectionString` | `host` |
| Messaging/rabbitMQ | `connectionString` | `host` |
| Data/mongoDatabases | `connectionString` | `endpoint` |
| Data/redisCaches | `url` | `host`, `port` |
| AI/models | `apiKey` | `endpoint` |
| AI/search | `apiKey` | `endpoint` |
| Storage/objectStorage | `connectionString`, `accountKey` | `endpoint`,
`accountName` |
## Decisions
- **Secret key names preserved** — redis keeps `url`, storage keeps
`accountKey`. This is a secret-handling *mechanism* change, not a
rename, so existing consumers of the key names are unaffected (the value
now arrives via the managed secret instead of a resource property).
- **SQL types out of scope** — `mySqlDatabases`, `postgreSqlDatabases`,
`sqlServerDatabases` use secret *inputs*, not outputs, and are
unchanged.
- **Testing/CI stays in `resource-types-verification`** — this PR only
updates the type definitions, recipe pack, and `test/app.bicep`; no CI
workflows are moved here.
## Dependency
Requires the engine support in **radius-project/radius#12344** (fold the
secret reference into the `secrets` block as `secrets.name`; read recipe
secret mappings from nested `outputs.secrets`). The
`validate-resource-types` CI runs against `rad edge`, so it will not go
green until #12344 is merged and released to `edge`. The same pattern is
validated end-to-end on real Azure across all seven types in
`resource-types-verification` (7 base + 7 app workflows green).
Kept as a **draft** pending the engine release.
Signed-off-by: willdavsmith <willdavsmith@gmail.com>1 parent ab9722a commit cf57799
22 files changed
Lines changed: 294 additions & 62 deletions
File tree
- AI
- models
- test
- search
- test
- Data
- mongoDatabases
- test
- redisCaches
- test
- Messaging
- kafka
- test
- rabbitMQ
- test
- Storage/objectStorage
- test
- recipepack/azure
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
74 | 91 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
70 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
78 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
0 commit comments