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

Update lua-resty-openidc to 1.7.1-1 and add redirect_uri #114

Open
wants to merge 1 commit 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
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ language: python
sudo: true

env:
- LUA_VERSION="5.1" KONG_VERSION="0.13.0-0" LUA_RESTY_OPENIDC_VERSION="1.6.0"
- LUA_VERSION="5.1" KONG_VERSION="0.12.3-0" LUA_RESTY_OPENIDC_VERSION="1.6.0"
- LUA_VERSION="5.1" KONG_VERSION="0.11.2-0" LUA_RESTY_OPENIDC_VERSION="1.6.0"
- LUA_VERSION="5.1" KONG_VERSION="1.0.2-0" LUA_RESTY_OPENIDC_VERSION="1.6.0"
- LUA_VERSION="5.1" KONG_VERSION="0.13.0-0" LUA_RESTY_OPENIDC_VERSION="1.7.1-1"
- LUA_VERSION="5.1" KONG_VERSION="0.12.3-0" LUA_RESTY_OPENIDC_VERSION="1.7.1-1"
- LUA_VERSION="5.1" KONG_VERSION="0.11.2-0" LUA_RESTY_OPENIDC_VERSION="1.7.1-1"
- LUA_VERSION="5.1" KONG_VERSION="1.0.2-0" LUA_RESTY_OPENIDC_VERSION="1.7.1-1"

script:
- sudo -E bash ci/root.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

export LUA_VERSION=${LUA_VERSION:-5.1}
export KONG_VERSION=${KONG_VERSION:-0.13.1-0}
export LUA_RESTY_OPENIDC_VERSION=${LUA_RESTY_OPENIDC_VERSION:-1.6.0}
export LUA_RESTY_OPENIDC_VERSION=${LUA_RESTY_OPENIDC_VERSION:-1.7.1-1}

pip install hererocks
hererocks lua_install -r^ --lua=${LUA_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion kong-oidc-1.1.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description = {
license = "Apache 2.0"
}
dependencies = {
"lua-resty-openidc ~> 1.6.0"
"lua-resty-openidc ~> 1.7.1-1"
}
build = {
type = "builtin",
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/oidc/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ return {
bearer_only = { type = "string", required = true, default = "no" },
realm = { type = "string", required = true, default = "kong" },
redirect_uri_path = { type = "string" },
redirect_uri = { 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" },
Expand Down
8 changes: 7 additions & 1 deletion kong/plugins/oidc/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function M.get_redirect_uri_path(ngx)
end

function M.get_options(config, ngx)
return {
local options = {
client_id = config.client_id,
client_secret = config.client_secret,
discovery = config.discovery,
Expand All @@ -59,6 +59,12 @@ function M.get_options(config, ngx)
logout_path = config.logout_path,
redirect_after_logout_uri = config.redirect_after_logout_uri,
}

if not config.redirect_uri then
options["redirect_uri_path"] = config.redirect_uri_path or M.get_redirect_uri_path(ngx)
end

return options
end

function M.exit(httpStatusCode, message, ngxCode)
Expand Down
4 changes: 2 additions & 2 deletions test/docker/integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN luarocks install luaunit
RUN luarocks install lua-cjson

# Change openidc version when version in rockspec changes
RUN luarocks install lua-resty-openidc 1.6.0
RUN luarocks install lua-resty-openidc 1.7.1-1

COPY . /usr/local/kong-oidc
COPY . /usr/local/kong-oidc
4 changes: 2 additions & 2 deletions test/docker/unit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ RUN luarocks install luaunit
RUN luarocks install lua-cjson

# Change openidc version when version in rockspec changes
RUN luarocks install lua-resty-openidc 1.6.0
RUN luarocks install lua-resty-openidc 1.7.1-1

WORKDIR /usr/local/kong-oidc

COPY . .
COPY . .