bug: openid-connect yml conf could not use $env to set plugin properties
Current Behavior
When I use yaml config to set plugin properties, apisix openid-connect plugin could not read $env://KEYCLOAK_PWDvalue. Environment variable can be seen through linux cmd:
echo $KEYCLOAK_PWD
But apisix plugin could not read those config properties
Expected Behavior
Apisix plugin can read those config properties
Error Logs
No response
Steps to Reproduce
- Create config(Show only key code)
- uri: /api/xxx/*
service_id: xxxx
plugins:
openid-connect:
client_id: xxx
client_secret: $ENV://KEYCLOAK_PWD
discovery: xxxx
scope: openid
Environment
- APISIX version (3.2.0):
- Operating system (Linux 3.10.0-1160.118.1.el7.x86_64 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux):
- OpenResty / Nginx version (openresty/1.21.4.2):
- etcd version, if relevant (not use):
- APISIX Dashboard version, if relevant(not use)
Could you change $env: to all caps and try again? I remember some time ago there was a PR allowing ENV to be lower case, but that was definitely available after 3.2.0.
Could you change
$env:to all caps and try again? I remember some time ago there was a PR allowingENVto be lower case, but that was definitely available after 3.2.0.
client_secret: $ENV://FS_KEYCLOAK_PWD
Emmmm.....I've tried all caps and it doesn't work.
By checking
you need to add
local fetch_secrets = require("apisix.secret").fetch_secrets
and
function _M.rewrite(plugin_conf, ctx)
local conf = fetch_secrets(plugin_conf)
like https://github.com/apache/apisix/pull/11451
Duplicate of #12219