feat: allow to use secrets in clickhouse-logger plugin#12951
Conversation
This will allow to store credential information like user/password in environment variables or HashiCorp Vault.
There was a problem hiding this comment.
Pull request overview
Enables clickhouse-logger plugin configurations to reference secrets (e.g., credentials) via $ENV://... or $secret://..., allowing credentials to be stored outside of etcd (env vars / Vault) while keeping runtime behavior unchanged.
Changes:
- Resolve secret references at send time in
clickhouse-loggerviaapisix.secret.fetch_secrets. - Add a new integration test covering
$ENV://...usage for ClickHouse credentials. - Update English and Chinese plugin docs to mention secret/environment-variable support.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
apisix/plugins/clickhouse-logger.lua |
Fetches and resolves secret references from plugin conf before sending logs to ClickHouse. |
t/plugin/clickhouse-logger3.t |
Adds test coverage for using $ENV://... in ClickHouse logger config. |
docs/en/latest/plugins/clickhouse-logger.md |
Documents that plugin attributes can be sourced from env/secrets. |
docs/zh/latest/plugins/clickhouse-logger.md |
Same documentation update for Chinese docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
moonming
left a comment
There was a problem hiding this comment.
Hi @vlad-vinogradov-47, thank you for adding secrets support to clickhouse-logger!
Consistency across logger plugins is important — other loggers already support $secret:// references. With 7 reviews and both tests and documentation included, this looks thorough. I'll review the code in detail shortly.
Description
This will allow to store credential information like user/password in environment variables or HashiCorp Vault.
Checklist