Skip to content

Commit

Permalink
tests: add basic unittest.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodman10 committed Jul 30, 2023
1 parent 82e00ce commit 09644e4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions t/admin/api.t
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,34 @@ GET /apisix/admin/routes
--- error_code: 200
--- error_log
Admin key is bypassed!
=== TEST 16: store api key into vault
--- exec
VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault kv put kv/apisix/apisix_config admin_key=value
--- response_body
Success! Data written to: kv/apisix/apisix_config
=== TEST 17: Access with api key from vault
--- main_config
env VAULT_TOKEN=root;
--- yaml_config
deployment:
admin:
admin_key:
- key: "$secret://apisix_config/admin_key"
name: a
role: admin
secret_vault:
enable: true
uri: "http://127.0.0.1:8200"
prefix: "kv/apisix"
token: "${{VAULT_TOKEN}}"
--- request
GET /apisix/admin/routes
--- more_headers
X-API-KEY: value
--- error_code: 200

0 comments on commit 09644e4

Please sign in to comment.