-
Notifications
You must be signed in to change notification settings - Fork 124
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
Wrap discovery and callback calls #2933
Conversation
38701a4
to
362d7cf
Compare
jwks = { | ||
keys: @discovered_provider.jwks |
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.
@john-odonnell This is still a WIP, but I'm curious if you have thoughts about this: turns out that .jwks
makes a separate call to the provider's JWKS uri so the cert needs to be available for that as well.
As a workaround I added an optional jwks
flag to the custom Client.discover
which updates the lambda to include the .jwks
call accordingly. Feels a bit hacky but better than the alternative of adding yet another wrapper imo.
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 was going to say:
I think the only downside to this is that we wouldn't be able to take advantage of previously cached discovery responses.
but as it turns out, the DiscoverIdentityProvider
class was never using the discovery cache anyways. Maybe this is a future low-hanging advancement.
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.
Otherwise, you're right - feels hacky, but I think this works for now. Makes me think that ditching the underlying OIDC client gem might make all this a bit cleaner, though.
d = -> { discovery_configuration.discover!(provider_uri) } | ||
case jwks | ||
when false | ||
d = -> { discovery_configuration.discover!(provider_uri) } |
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.
Authentication::AuthnOidc::V2::Client#self.discover calls 'discovery_configuration.discover!(provider_uri)' 2 times
) | ||
d = -> { discovery_configuration.discover!(provider_uri) } | ||
case jwks |
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.
Authentication::AuthnOidc::V2::Client#self.discover is controlled by argument 'jwks'
CHANGELOG.md
Outdated
@@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |||
[cyberark/conjur#2901](https://github.com/cyberark/conjur/pull/2901) | |||
|
|||
### Added | |||
- Support an optional`ca-cert` variable for providing custom certs/chains for to verify |
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.
- Support an optional`ca-cert` variable for providing custom certs/chains for to verify | |
- Support an optional`ca-cert` variable for providing custom certs/chains to verify |
jwks = { | ||
keys: @discovered_provider.jwks |
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 was going to say:
I think the only downside to this is that we wouldn't be able to take advantage of previously cached discovery responses.
but as it turns out, the DiscoverIdentityProvider
class was never using the discovery cache anyways. Maybe this is a future low-hanging advancement.
jwks = { | ||
keys: @discovered_provider.jwks |
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.
Otherwise, you're right - feels hacky, but I think this works for now. Makes me think that ditching the underlying OIDC client gem might make all this a bit cleaner, though.
560c526
to
89dd2af
Compare
89dd2af
to
932bb49
Compare
Code Climate has analyzed commit 932bb49 and detected 5 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 88.5% (0.0% change). View more on Code Climate. |
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 👍
Desired Outcome
Implement the wrapper methods introduced in #2919 and the optional
ca-cert
config in #2920 to allow custom certs to be provided in the OIDC authenticator config.Implemented Changes
ca-cert
variable instead of container truststore (includes integration tests)Connected Issue/Story
CNJR-2476
Definition of Done
At least 1 todo must be completed in the sections below for the PR to be
merged.
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
README
s) were updated in this PRBehavior
Security