shreemaan-abhishek commented on code in PR #8866:
URL: https://github.com/apache/apisix/pull/8866#discussion_r1107961505
##########
t/config-center-yaml/secret.t:
##########
@@ -388,3 +392,131 @@ env secret=apisix;
GET /t
--- response_body
nil
+
+
+
+=== TEST 17: validate secret/vault with the token in an env var: wrong schema
+--- apisix_yaml
+secrets:
+ - id: vault/1
+ prefix: kv/apisix
+ token: "$ENV://VAULT_TOKEN"
+ uri: 127.0.0.1:8200
+#END
+--- config
+ location /t {
+ content_by_lua_block {
+ local secret = require("apisix.secret")
+ local values = secret.secrets()
+ ngx.say(#values)
+ }
+ }
+--- request
+GET /t
+--- response_body
+0
+--- error_log
+property "uri" validation failed: failed to match pattern
"^[^\\/]+:\\/\\/([\\da-zA-Z.-]+|\\[[\\da-fA-F:]+\\])(:\\d+)?"
Review Comment:
I just duplicated all the test cases containing the token with just one
change: replace the token with the environment variable. Let me do something
better. 😂
--
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]