Skip to content

Commit

Permalink
fix lint test
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
  • Loading branch information
Revolyssup committed Nov 16, 2023
1 parent b0861e3 commit 5962fd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apisix/plugins/openid-connect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ local function add_access_token_header(ctx, conf, token)
end

-- Function to split the scope string into a table
function split_scopes_by_space(scope_string)
local function split_scopes_by_space(scope_string)
local scopes = {}
for scope in string.gmatch(scope_string, "%S+") do
scopes[scope] = true
Expand All @@ -332,7 +332,7 @@ function split_scopes_by_space(scope_string)
end

-- Function to check if all required scopes are present
function required_scopes_present(required_scopes, http_scopes)
local function required_scopes_present(required_scopes, http_scopes)
for _, scope in ipairs(required_scopes) do
if not http_scopes[scope] then
return false
Expand Down Expand Up @@ -382,7 +382,8 @@ function _M.rewrite(plugin_conf, ctx)
if not is_authorized then
core.log.error("OIDC introspection failed: ", "required scopes not present")
local error_response = {
error = "required scopes " .. table.concat(conf.required_scopes, ", ") .. " not present"
error = "required scopes " .. table.concat(conf.required_scopes, ", ") ..
" not present"
}
return 403, core.json.encode(error_response)
end
Expand Down

0 comments on commit 5962fd6

Please sign in to comment.