Skip to content

Commit

Permalink
[token_introspection] Remove algorithm enum from the schema
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tkan145 committed Jun 17, 2024
1 parent 78c63f8 commit 3a7aee4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 0 additions & 10 deletions gateway/src/apicast/policy/token_introspection/apicast-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
"description": "Audience. The aud claim of the singed JWT. The audience SHOULD be the URL of the Authorization Server’s Token Endpoint.",
"type": "string"
},
"client_jwt_assertion_algorithm": {
"type": "string",
"enum": ["HS256"],
"default": "HS256"
},
"introspection_url": {
"description": "Introspection Endpoint URL",
"type": "string"
Expand Down Expand Up @@ -120,11 +115,6 @@
"description": "Audience. The aud claim of the singed JWT. The audience SHOULD be the URL of the Authorization Server’s Token Endpoint.",
"type": "string"
},
"client_jwt_assertion_algorithm": {
"type": "string",
"enum": ["RS256"],
"default": "RS256"
},
"certificate_type": {
"title": "Certificate type",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function _M.new(config)
if self.auth_type == "client_secret_jwt" or self.auth_type == "private_key_jwt" then
self.client_jwt_assertion_expires_in = self.config.client_jwt_assertion_expires_in or 60
self.client_aud = config.client_jwt_assertion_audience or ''
self.client_algorithm = config.client_jwt_assertion_algorithm
end

if self.auth_type == "private_key_jwt" then
Expand Down Expand Up @@ -129,7 +128,7 @@ local function introspect_token(self, token)
local assertion = {
header = {
typ = "JWT",
alg = self.client_algorithm,
alg = self.auth_type == "client_secret_jwt" and "HS256" or "RS256",
},
payload = {
iss = self.client_id,
Expand Down

0 comments on commit 3a7aee4

Please sign in to comment.