Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(proxy): add ability to enable http/https proxy #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -82,6 +82,8 @@ You also need to set the `KONG_CUSTOM_PLUGINS` environment variable
| `config.bearer_only` | no | false | Only introspect tokens without redirecting |
| `config.realm` | kong | false | Realm used in WWW-Authenticate response header |
| `config.logout_path` | /logout | false | Absolute path used to logout from the OIDC RP |
| `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

Expand Down
2 changes: 2 additions & 0 deletions kong/plugins/oidc/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ return {
recovery_page_path = { type = "string" },
logout_path = { type = "string", required = false, default = '/logout' },
redirect_after_logout_uri = { type = "string", required = false, default = '/' },
http_proxy = { type = "string", required = false, default = '' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the default value for http_proxy and https_proxy. It's causing to always set the proxy and breaks in non proxy environment

https_proxy = { type = "string", required = false, default = '' },
filters = { type = "string" }
}
}
4 changes: 4 additions & 0 deletions kong/plugins/oidc/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function M.get_options(config, ngx)
filters = parseFilters(config.filters),
logout_path = config.logout_path,
redirect_after_logout_uri = config.redirect_after_logout_uri,
proxy_opts = {
http_proxy = config.http_proxy,
https_proxy = config.https_proxy
}
}
end

Expand Down