-
Notifications
You must be signed in to change notification settings - Fork 171
THREESCALE-11441 only validate oidc setting if authentication method is set to oidc #1568
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
base: master
Are you sure you want to change the base?
Conversation
842cd5f to
2bd8459
Compare
2bd8459 to
121e6ef
Compare
josemigallas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor suggestions
| }, config.oidc) | ||
| end) | ||
|
|
||
| it('ingore OIDC configuration when authentication_method is not oidc', function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it('ingore OIDC configuration when authentication_method is not oidc', function() | |
| it('ignore OIDC configuration when authentication_method is not oidc', function() |
| -- Only fetch OIDC configuration if authentication method is set to 'oidc' | ||
| local authentication = proxy.authentication_method or service.backend_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment could go away by simply extracting a guard from the code below:
| -- Only fetch OIDC configuration if authentication method is set to 'oidc' | |
| local authentication = proxy.authentication_method or service.backend_version | |
| local authentication = proxy.authentication_method or service.backend_version | |
| if authentication ~= 'oidc' then | |
| return nil | |
| end |
The if authentication part seems redundant anyway (nil is already unequal to 'oidc').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The authentication can take the following values:
1: user_key2: app_id/app_keyoidc: OIDCnil: But if theoidc_issuer_endpointis provided, then in this case we don't want to query OIDC endpoint
Therefore, an if statement is needed.
| local authentication = proxy.authentication_method or service.backend_version | ||
|
|
||
| if authentication and authentication == 'oidc' then | ||
| local result = _M.discovery:call(service.proxy.oidc_issuer_endpoint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxy already declared on the top
| local result = _M.discovery:call(service.proxy.oidc_issuer_endpoint) | |
| local result = _M.discovery:call(proxy.oidc_issuer_endpoint) |
What
Fix https://issues.redhat.com/browse/THREESCALE-11441
Verification steps
apicast-config.jsonas followand docker-compose
the gateway should output the following
Check the log again and you should not see the same error