Commit 23d8621
committed
Remove config templating in favour of explicit secret references
After extensive testing and some initial user feedback, it became clear that expressions / templating provides horrible UX, because:
* It's not clear where expressions can be used.
* Expressions are only evaluated at runtime, so users don't get feedback when they reference secrets that don't exist.
* Non-technical users struggle with expression syntax.
Additionally, we don't really *need* the flexibility expressions give us. We just need a way to safely reference managed secrets.
This change introduces support for the `x-secret-ref` JSON schema annotation. Properties annotated with it will be treated as secret references.
When extensions retrieve their runtime config, secret references are transparently resolved.
When extension configs are updated via REST API, it's validated that all referenced secrets exist.
Secret managers now support pagination and filtering for the `listSecrets` operation. This is used to deliver a convenient dropdown with search-as-you-type in the UI. Note that it is expected that not all providers can support pagination natively, in which case they'll need to emulate the desired behaviour, which is what the `env` provider does.
Listing secret metadata no longer requires the `SECRET_MANAGEMENT_READ` permission, but the `SYSTEM_CONFIGURATION_READ` permission. This is because users who maintain configuration are actually the ones that need to know which secrets they can use.
Signed-off-by: nscuro <nscuro@protonmail.com>1 parent 27c90a8 commit 23d8621
51 files changed
Lines changed: 1130 additions & 801 deletions
File tree
- apiserver/src
- main/java/org/dependencytrack
- auth
- config/templating
- plugin
- resources/v2
- secret
- test/java/org/dependencytrack
- auth
- config/templating
- event
- kafka/processor
- plugin
- resources
- v1
- v2
- secret
- tasks
- api/src/main/openapi
- components/schemas/secrets
- paths
- migration/src/main/resources/migration
- plugin
- runtime
- src
- main/java/org/dependencytrack/plugin/runtime/config
- test
- java/org/dependencytrack/plugin/runtime/config
- resources
- org/dependencytrack/plugin/runtime/config
- vuln-data-source-github/src
- main
- java/org/dependencytrack/datasource/vuln/github
- resources/org/dependencytrack/datasource/vuln/github
- test/java/org/dependencytrack/datasource/vuln/github
- secret-management
- src
- main/java/org/dependencytrack/secret/management
- cache
- database
- env
- test/java/org/dependencytrack/secret/management
- cache
- database
- env
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
25 | 22 | | |
26 | | - | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | | - | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
17 | 49 | | |
18 | 50 | | |
19 | 51 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
112 | | - | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
Lines changed: 0 additions & 107 deletions
This file was deleted.
Lines changed: 0 additions & 150 deletions
This file was deleted.
0 commit comments