Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support more sensitive fields for encryption #11095

Merged
merged 15 commits into from
Mar 29, 2024
3 changes: 2 additions & 1 deletion apisix/plugins/aws-lambda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ local aws_authz_schema = {
},
required = {"accesskey", "secretkey"}
}
}
},
encrypt_fields = {"apikey", "iam.accesskey", "iam.secretkey"}
}

local function request_processor(conf, ctx, params)
Expand Down
6 changes: 4 additions & 2 deletions apisix/plugins/azure-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ local azure_authz_schema = {
properties = {
apikey = {type = "string"},
clientid = {type = "string"}
}
},
encrypt_fields = {"apikey"},
}

local metadata_schema = {
type = "object",
properties = {
master_apikey = {type = "string", default = ""},
master_clientid = {type = "string", default = ""}
}
},
encrypt_fields = {"master_apikey"}
}

local function request_processor(conf, ctx, params)
Expand Down
1 change: 1 addition & 0 deletions apisix/plugins/jwe-decrypt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ local consumer_schema = {
is_base64_encoded = { type = "boolean" },
},
required = { "key", "secret" },
encrypt_fields = { "key", "secret" },
}


Expand Down
2 changes: 1 addition & 1 deletion apisix/plugins/openid-connect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ local schema = {
}
}
},
encrypt_fields = {"client_secret"},
encrypt_fields = {"client_secret", "client_rsa_private_key"},
required = {"client_id", "client_secret", "discovery"}
}

Expand Down
3 changes: 2 additions & 1 deletion apisix/plugins/openwhisk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ local schema = {
keepalive_timeout = {type = "integer", minimum = 1000, default = 60000},
keepalive_pool = {type = "integer", minimum = 1, default = 5}
},
required = {"api_host", "service_token", "namespace", "action"}
required = {"api_host", "service_token", "namespace", "action"},
encrypt_fields = {"service_token"}
}


Expand Down
1 change: 1 addition & 0 deletions apisix/utils/redis-schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ local policy_to_additional_properties = {
},
},
required = {"redis_host"},
encrypt_fields = {"redis_password"}
},
["redis-cluster"] = {
properties = {
Expand Down
6 changes: 4 additions & 2 deletions t/plugin/authz-casdoor.t
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ done
"upstream": {
"type": "roundrobin",
"nodes": {
"test.com:1980": 1
"127.0.0.1:1980": 1
}
}
}]]
Expand Down Expand Up @@ -477,7 +477,7 @@ apisix:
"upstream": {
"type": "roundrobin",
"nodes": {
"test.com:1980": 1
"127.0.0.1:1980": 1
}
}
}]]
Expand Down Expand Up @@ -506,6 +506,8 @@ apisix:
-- get plugin conf from etcd, password is encrypted
local etcd = require("apisix.core.etcd")
local res = assert(etcd.get('/routes/1'))
local core = require("apisix.core")
core.log.warn("dibag", core.json.encode(res.body.node.value.plugins["authz-casdoor"].client_secret))
shreemaan-abhishek marked this conversation as resolved.
Show resolved Hide resolved
ngx.say(res.body.node.value.plugins["authz-casdoor"].client_secret)
}
}
Expand Down
Loading