Skip to content

Commit

Permalink
modify tests to use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
shreemaan-abhishek committed Feb 15, 2023
1 parent aa8b1bd commit 7f938e2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions t/config-center-yaml/secret.t
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ __DATA__
secrets:
- id: vault/1
prefix: kv/apisix
token: root
token: "$ENV://VAULT_TOKEN"
uri: 127.0.0.1:8200
#END
--- config
Expand All @@ -86,7 +86,7 @@ property "uri" validation failed: failed to match pattern "^[^\\/]+:\\/\\/([\\da
secrets:
- id: hhh/1
prefix: kv/apisix
token: root
token: "$ENV://VAULT_TOKEN"
uri: 127.0.0.1:8200
#END
--- config
Expand All @@ -111,7 +111,7 @@ secret manager not exits
secrets:
- id: vault/1
prefix: kv/apisix
token: root
token: "$ENV://VAULT_TOKEN"
uri: http://127.0.0.1:8200
#END
--- config
Expand All @@ -133,7 +133,7 @@ GET /t
len: 1
id: vault/1
prefix: kv/apisix
token: root
token: $ENV://VAULT_TOKEN
uri: http://127.0.0.1:8200
Expand All @@ -151,7 +151,7 @@ Success! Data written to: kv/apisix/apisix-key
secrets:
- id: vault/1
prefix: kv/apisix
token: root
token: "$ENV://VAULT_TOKEN"
uri: http://127.0.0.1:8200
#END
--- config
Expand Down
2 changes: 1 addition & 1 deletion t/plugin/basic-auth.t
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ GET /t
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)

Expand Down
2 changes: 1 addition & 1 deletion t/plugin/hmac-auth4.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ __DATA__
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)
Expand Down
2 changes: 1 addition & 1 deletion t/plugin/jwt-auth3.t
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ GET /t
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)
Expand Down
2 changes: 1 addition & 1 deletion t/plugin/key-auth.t
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ auth: authone
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)

Expand Down
2 changes: 1 addition & 1 deletion t/plugin/ldap-auth.t
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ GET /t
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)
Expand Down
2 changes: 1 addition & 1 deletion t/plugin/wolf-rbac.t
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ ERR_TOKEN_INVALID
[[{
"uri": "http://127.0.0.1:8200",
"prefix" : "kv/apisix",
"token" : "root"
"token" : "$ENV://VAULT_TOKEN"
}]]
)
Expand Down
10 changes: 5 additions & 5 deletions t/secret/vault.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ __DATA__
local vault = require("apisix.secret.vault")
local conf = {
prefix = "/kv/prefix",
token = "root",
token = "$ENV://VAULT_TOKEN",
uri = "http://127.0.0.1:2800"
}
local data, err = vault.get(conf, "apisix")
Expand All @@ -57,7 +57,7 @@ error key format, key: apisix
local vault = require("apisix.secret.vault")
local conf = {
prefix = "/kv/prefix",
token = "root",
token = "$ENV://VAULT_TOKEN",
uri = "http://127.0.0.1:2800"
}
local data, err = vault.get(conf, "/apisix")
Expand All @@ -82,7 +82,7 @@ can't find main key, key: /apisix
local vault = require("apisix.secret.vault")
local conf = {
prefix = "/kv/prefix",
token = "root",
token = "$ENV://VAULT_TOKEN",
uri = "http://127.0.0.1:2800"
}
local data, err = vault.get(conf, "apisix/")
Expand All @@ -107,7 +107,7 @@ can't find sub key, key: apisix/
local vault = require("apisix.secret.vault")
local conf = {
prefix = "/kv/prefix",
token = "root",
token = "$ENV://VAULT_TOKEN",
uri = "http://127.0.0.2:2800"
}
local data, err = vault.get(conf, "/apisix/sub")
Expand Down Expand Up @@ -141,7 +141,7 @@ Success! Data written to: kv/apisix/apisix-key/jack
local vault = require("apisix.secret.vault")
local conf = {
prefix = "kv/apisix",
token = "root",
token = "$ENV://VAULT_TOKEN",
uri = "http://127.0.0.1:8200"
}
local value, err = vault.get(conf, "/apisix-key/jack/key")
Expand Down

0 comments on commit 7f938e2

Please sign in to comment.