Skip to content

Remove config templating in favour of explicit secret references#1657

Merged
nscuro merged 1 commit intomainfrom
secret-refs
Jan 15, 2026
Merged

Remove config templating in favour of explicit secret references#1657
nscuro merged 1 commit intomainfrom
secret-refs

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Jan 14, 2026

Description

Removes config templating in favour of explicit secret references.

Addressed Issue

N/A

Additional Details

Frontend PR: DependencyTrack/hyades-frontend#388
Docs PR: DependencyTrack/hyades#1992

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.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro added this to the 5.7.0 milestone Jan 14, 2026
@nscuro nscuro added the enhancement New feature or request label Jan 14, 2026
@nscuro nscuro force-pushed the secret-refs branch 3 times, most recently from ced415c to 1ed6173 Compare January 15, 2026 13:57
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jan 15, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.05% (target: -1.00%) 93.04% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (27c90a8) 36293 30419 83.82%
Head commit (1ee1ca7) 36387 (+94) 30515 (+96) 83.86% (+0.05%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1657) 230 214 93.04%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@nscuro nscuro marked this pull request as ready for review January 15, 2026 15:02
Copilot AI review requested due to automatic review settings January 15, 2026 15:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes configuration templating in favor of explicit secret references, addressing usability concerns with expression-based secret handling. The new approach uses the x-secret-ref JSON schema annotation to mark properties as secret references, which are validated at configuration update time and transparently resolved at runtime.

Changes:

  • Replaced expression/templating-based secret references with explicit x-secret-ref JSON schema annotations
  • Added pagination and filtering support to secret metadata listing operations
  • Changed secret listing permission from SECRET_MANAGEMENT_READ to SYSTEM_CONFIGURATION_READ

Reviewed changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
secret-management/** Added pagination support with ListSecretsRequest and getSecretMetadata method to SecretManager interface
plugin/runtime/** Added resolveSecretRefs method to resolve x-secret-ref annotations and validate secret existence
apiserver/** Removed ConfigTemplateRenderer and related templating classes; updated PluginManager to use direct secret resolution
api/** Updated OpenAPI specs to add getSecretMetadata endpoint, pagination support, and changed permissions
migration/** Added migration to delete the SECRET_MANAGEMENT_READ permission

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro force-pushed the secret-refs branch 2 times, most recently from 23d8621 to 3a704ce Compare January 15, 2026 15:18
@nscuro nscuro requested a review from Copilot January 15, 2026 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 51 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 51 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro merged commit 44ac6af into main Jan 15, 2026
18 checks passed
@nscuro nscuro deleted the secret-refs branch January 15, 2026 16:49
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants