soulbird commented on code in PR #8601:
URL: https://github.com/apache/apisix/pull/8601#discussion_r1061191660
##########
t/plugin/hmac-auth3.t:
##########
@@ -755,3 +755,146 @@ apisix:
--- response_body
my-secret-key
IRWpPjbDq5BCgHyIllnOMA==
+
+
+
+=== TEST 15: set hmac-auth conf: secret_key uses secret ref
+--- request
+GET /t
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ -- put secret vault config
+ local code, body = t('/apisix/admin/secrets/vault/test1',
+ ngx.HTTP_PUT,
+ [[{
+ "uri": "http://127.0.0.1:8200",
+ "prefix" : "kv/apisix",
+ "token" : "root"
+ }]],
+ [[{
+ "value": {
+ "uri": "http://127.0.0.1:8200",
+ "prefix" : "kv/apisix",
+ "token" : "root"
+ },
+ "key": "/apisix/secrets/vault/test1"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ return ngx.say(body)
+ end
+
+ -- change consumer with secrets ref: vault
+ code, body = t('/apisix/admin/consumers',
+ ngx.HTTP_PUT,
+ [[{
+ "username": "jack",
+ "plugins": {
+ "hmac-auth": {
+ "access_key": "my-access-key",
+ "secret_key":
"$secret://vault/test1/jack/secret_key"
+ }
+ }
+ }]]
+ )
+ if code >= 300 then
+ ngx.status = code
+ return ngx.say(body)
+ end
+
+ -- set route
+ code, body = t('/apisix/admin/routes/1',
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]