Skip to content

Commit

Permalink
[resty.oidc] allow stubbing http backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed Sep 27, 2018
1 parent a5d2075 commit 01112b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gateway/src/resty/oidc/discovery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ local _M = { }

local mt = { __index = _M }

-- to be overridden in tests
function _M.http_backend() end

local function openid_configuration_url(issuer)
if issuer and type(issuer) == 'string' and len(issuer) > 0 then
return resty_url.join(issuer, '.well-known/openid-configuration')
Expand All @@ -35,7 +38,7 @@ end

function _M.new(http_backend)
local http_client = http_ng.new{
backend = http_backend,
backend = http_backend or _M.http_backend(),
options = {
ssl = { verify = resty_env.enabled('OPENSSL_VERIFY') }
}
Expand Down

0 comments on commit 01112b5

Please sign in to comment.