Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Added option to use Proxy #39

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ If you're using `luarocks` execute the following:
| `config.bearer_jwt_auth_signing_algs` | [ 'RS256' ] | false | List of allowed signing algorithms for Authorization header JWT token validation. Must match to OIDC provider and `resty-openidc` supported algorithms |
| `config.header_names` | | false | List of custom upstream HTTP headers to be added based on claims. Must have same number of elements as `config.header_claims`. Example: `[ 'x-oidc-email', 'x-oidc-email-verified' ]` |
| `config.header_claims` | | false | List of claims to be used as source for custom upstream headers. Claims are sourced from Userinfo, ID Token, Bearer JWT, Introspection, depending on auth method. Use only claims containing simple string values. Example: `[ 'email', 'email_verified'` |
| `config.http_proxy` || false | http proxy url |
| `config.https_proxy` || false | https proxy url (only supports url format __http__://proxy and not __https__://proxy) |

### Enabling kong-oidc

Expand Down
12 changes: 12 additions & 0 deletions kong/plugins/oidc/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,18 @@ return {
},
default = {}
}
},
{
http_proxy = {
type = "string",
required = false
}
},
{
https_proxy = {
type = "string",
required = false
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion kong/plugins/oidc/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ function M.get_options(config, ngx)
bearer_jwt_auth_allowed_auds = config.bearer_jwt_auth_allowed_auds,
bearer_jwt_auth_signing_algs = config.bearer_jwt_auth_signing_algs,
header_names = config.header_names or {},
header_claims = config.header_claims or {}
header_claims = config.header_claims or {},
proxy_opts = {
http_proxy = config.http_proxy,
https_proxy = config.https_proxy
}
}
end

Expand Down