Skip to content

Add EIP 0038: secret registry for data-integration templates#107

Open
zmstone wants to merge 1 commit into
emqx:mainfrom
zmstone:260521-secret-registry-eip
Open

Add EIP 0038: secret registry for data-integration templates#107
zmstone wants to merge 1 commit into
emqx:mainfrom
zmstone:260521-secret-registry-eip

Conversation

@zmstone

@zmstone zmstone commented May 21, 2026

Copy link
Copy Markdown
Member

Introduces a cluster-wide secret registry application that stores named byte strings, exposes a management HTTP API gated under the existing data_integration API-key scope, and surfaces values to consumers through three access paths matched to the shape of each consumer:

  • $secret{<name>} placeholder for template-rendered output (HTTP bridge headers / URLs / bodies, authn / authz HTTP request templates) — log-channel-safe; the placeholder is preserved verbatim in every trace / debug path while the wire sees the substituted value.
  • get_secret('<name>') rule SQL function as an escape hatch for cases where the secret value must participate in a SQL expression (HMAC signing, multi-input composition). Documented to leak through rule trace output when tracing is enabled — used sparingly.
  • secret://<name> URI for HOCON secret-typed fields (action / source / connector passwords and API tokens). Slots into the existing emqx_schema_secret / emqx_secret_loader / emqx_utils_redact plumbing as a parallel clause to file://.

Targets EMQX v7.

Read-back via the management API returns metadata only — the stored byte string never leaves the broker except through one of the three resolution paths above. Backup / export excludes the registry by default.

Non-goals for v1: encryption at rest with broker-managed master key (defer to filesystem encryption), external secret-broker integration (Vault, AWS Secrets Manager), and automatic rotation / TTL.

Declined alternatives documented in the EIP: rule function as the only access surface, encryption at rest, external broker integration, returning the value via GET, TTL / auto-rotation, and allowing the placeholder in MQTT topics / payloads.


* `emqx_template` (the main template renderer used by HTTP bridge
headers, URLs, bodies, and by `emqx_auth_http_utils`).
* `emqx_placeholder` (the legacy placeholder substitutor used in

@savonarola savonarola May 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it makes sence in v7 to

  • get rid of legacy templating
  • make a more or less frormal spec for the template syntax

We have another tasks requiring templating changes, e.g. support of table name interpolation, so it would be nice to reduce adhoc changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants