-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added anonymous support compatible with kong 1.0.X
- Loading branch information
emoj
authored and
emoj
committed
Apr 9, 2019
1 parent
f0c573c
commit 0558791
Showing
2 changed files
with
101 additions
and
47 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,24 +1,41 @@ | ||
local typedefs = require "kong.db.schema.typedefs" | ||
|
||
local function validate_flows(config) | ||
|
||
return true | ||
|
||
end | ||
|
||
return { | ||
no_consumer = true, | ||
name = "oidc", | ||
fields = { | ||
anonymous = { type = "string", uuid = true, legacy = true }, | ||
client_id = { type = "string", required = true }, | ||
client_secret = { type = "string", required = true }, | ||
discovery = { type = "string", required = true, default = "https://.well-known/openid-configuration" }, | ||
introspection_endpoint = { type = "string", required = false }, | ||
timeout = { type = "number", required = false }, | ||
introspection_endpoint_auth_method = { type = "string", required = false }, | ||
bearer_only = { type = "string", required = true, default = "no" }, | ||
realm = { type = "string", required = true, default = "kong" }, | ||
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" }, | ||
logout_path = { type = "string", required = false, default = '/logout' }, | ||
redirect_after_logout_uri = { type = "string", required = false, default = '/' }, | ||
filters = { type = "string" } | ||
} | ||
{ consumer = typedefs.no_consumer }, | ||
{ run_on = typedefs.run_on_first }, | ||
{ config = { | ||
type = "record", | ||
fields = { | ||
{anonymous = { type = "string", uuid = true, legacy = true }}, | ||
{client_id = { type = "string", required = true }}, | ||
{client_secret = { type = "string", required = true }}, | ||
{discovery = { type = "string", required = true, default = "https://.well-known/openid-configuration" }}, | ||
{introspection_endpoint = { type = "string", required = false }}, | ||
{timeout = { type = "number", required = false }}, | ||
{introspection_endpoint_auth_method = { type = "string", required = false }}, | ||
{bearer_only = { type = "string", required = true, default = "no" }}, | ||
{realm = { type = "string", required = true, default = "kong" }}, | ||
{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" }}, | ||
{logout_path = { type = "string", required = false, default = '/logout' }}, | ||
{redirect_after_logout_uri = { type = "string", required = false, default = '/' }}, | ||
{filters = { type = "string" }} | ||
}, | ||
custom_validator = validate_flows, | ||
}, | ||
}, | ||
}, | ||
} |