Skip to content

Commit 3a7aee4

Browse files
committed
[token_introspection] Remove algorithm enum from the schema
jsonschema validation fails randomly when enum contains only a single value. For now, remove the algorithm and use the hardcoded value until we can upgrade lua-resty-jwt and support additional signing algorithms.
1 parent 78c63f8 commit 3a7aee4

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

gateway/src/apicast/policy/token_introspection/apicast-policy.json

-10
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@
8484
"description": "Audience. The aud claim of the singed JWT. The audience SHOULD be the URL of the Authorization Server’s Token Endpoint.",
8585
"type": "string"
8686
},
87-
"client_jwt_assertion_algorithm": {
88-
"type": "string",
89-
"enum": ["HS256"],
90-
"default": "HS256"
91-
},
9287
"introspection_url": {
9388
"description": "Introspection Endpoint URL",
9489
"type": "string"
@@ -120,11 +115,6 @@
120115
"description": "Audience. The aud claim of the singed JWT. The audience SHOULD be the URL of the Authorization Server’s Token Endpoint.",
121116
"type": "string"
122117
},
123-
"client_jwt_assertion_algorithm": {
124-
"type": "string",
125-
"enum": ["RS256"],
126-
"default": "RS256"
127-
},
128118
"certificate_type": {
129119
"title": "Certificate type",
130120
"type": "string",

gateway/src/apicast/policy/token_introspection/token_introspection.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function _M.new(config)
6868
if self.auth_type == "client_secret_jwt" or self.auth_type == "private_key_jwt" then
6969
self.client_jwt_assertion_expires_in = self.config.client_jwt_assertion_expires_in or 60
7070
self.client_aud = config.client_jwt_assertion_audience or ''
71-
self.client_algorithm = config.client_jwt_assertion_algorithm
7271
end
7372

7473
if self.auth_type == "private_key_jwt" then
@@ -129,7 +128,7 @@ local function introspect_token(self, token)
129128
local assertion = {
130129
header = {
131130
typ = "JWT",
132-
alg = self.client_algorithm,
131+
alg = self.auth_type == "client_secret_jwt" and "HS256" or "RS256",
133132
},
134133
payload = {
135134
iss = self.client_id,

0 commit comments

Comments
 (0)