-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from nokia/Commit-6df8344f-from-gitlab-nokia
Commit 6df8344f from gitlab nokia
- Loading branch information
Showing
6 changed files
with
43 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
local M = {} | ||
|
||
local function startsWith(text, prefix) | ||
return string.sub(text, 1, string.len(prefix)) == prefix | ||
end | ||
|
||
local function shouldIgnoreRequest() | ||
local ignore_paths = "/auth,/arc" -- TODO. Need to have a common solution. | ||
for path in string.gmatch(ignore_paths, "[^,]+") do | ||
if ngx.var.uri == path or startsWith(ngx.var.uri, path.."/") then | ||
return true | ||
local function shouldIgnoreRequest(patterns) | ||
if (patterns) then | ||
for _, pattern in ipairs(patterns) do | ||
local isMatching = not (string.find(ngx.var.uri, pattern) == nil) | ||
if (isMatching) then return true end | ||
end | ||
end | ||
return false | ||
end | ||
|
||
|
||
function M.shouldProcessRequest() | ||
return not shouldIgnoreRequest() | ||
function M.shouldProcessRequest(config) | ||
return not shouldIgnoreRequest(config.filters) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
return { | ||
no_consumer = true, | ||
fields = { | ||
client_id = { type = "string", required = true}, | ||
client_secret = { type = "string", required = true}, | ||
discovery = { type = "string", required = true, default = "https://.well-known/openid-configuration"}, | ||
redirect_uri_path = { type = "string"}, | ||
scope = { type = "string", required = true, default = "openid"}, | ||
response_type = { type = "string", required = true, default = "code"}, | ||
ssl_verify = { type = "string", required = true, default = "no"}, | ||
token_endpoint_auth_method = { type = "string", required = true, default = "client_secret_post"}, | ||
session_secret = { type = "string", required = false, default = "no"}, | ||
recovery_page_path = { type = "string"} | ||
client_id = { type = "string", required = true }, | ||
client_secret = { type = "string", required = true }, | ||
discovery = { type = "string", required = true, default = "https://.well-known/openid-configuration" }, | ||
redirect_uri_path = { type = "string" }, | ||
scope = { type = "string", required = true, default = "openid" }, | ||
response_type = { type = "string", required = true, default = "code" }, | ||
ssl_verify = { type = "string", required = true, default = "no" }, | ||
token_endpoint_auth_method = { type = "string", required = true, default = "client_secret_post" }, | ||
session_secret = { type = "string", required = false }, | ||
recovery_page_path = { type = "string" }, | ||
filters = { type = "string" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters