Skip to content

Creating JwksFetcher interface and impl#4225

Closed
nickrmc83 wants to merge 0 commit intoenvoyproxy:masterfrom
thales-e-security:master
Closed

Creating JwksFetcher interface and impl#4225
nickrmc83 wants to merge 0 commit intoenvoyproxy:masterfrom
thales-e-security:master

Conversation

@nickrmc83
Copy link
Contributor

JwksFetcher wraps up HTTP acquisition of JWKS strings converting them into a concrete type on the way.
JwksFetcher is reusable so can be used in a wider context.

Tests updated and fixed where necessary.

Signed-off-by: Nick A. Smith nick.a.smith@thales-esecurity.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description:
We are in the process of implementing a new Envoy filter based on the design presented here and wish to re-use existing logic in the jwt_authn filter. We've split out the logic we're interested in into a new class called JwksFetcher. Later PRs will re-use the split out logic an OpenID Connect filter.

Risk Level:
Medium
Testing:
Add replacement and additional unit tests for the logic that's been moved.
Docs Changes:
None
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@nickrmc83 nickrmc83 requested a review from lizan as a code owner August 22, 2018 15:41
@nickrmc83
Copy link
Contributor Author

Ping @lizan @qiwzhang . Can you take a look at this PR please? I've moved a small amount of code about so that we can re-use the JwksFetcher in multiple filters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add comment to describe its usage? especially if its instance can be re-used for multiple fetching

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e6b6b0

Copy link
Contributor

Choose a reason for hiding this comment

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

rename it to cancel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to cancel() in e6b6b0 as per review comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

move xxxPtr definition to outside of class xxx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in e6b6b0 as per review comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

should we use && since you are using std::move for fetcher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in e6b6b0 as per review comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

should we call std::move for fetcher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in e6b6b0 as per review comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

can we pass a lambda function as fetcher_factory so fetcher is only created when it is needed, not always for each request?

@nickrmc83
Copy link
Contributor Author

This has turned into a bit of a mess. I'll fix before more review. Apologies

@nickrmc83 nickrmc83 closed this Aug 24, 2018
@nickrmc83
Copy link
Contributor Author

I've closed this PR as the history had become very messy. The failure on the CI and resultant DCO instructions around rebasing have not been kind. I'll create a new version.

htuch pushed a commit that referenced this pull request Sep 14, 2018
JwksFetcher wraps up HTTP acquisition of JWKS strings converting them into a concrete type on the way.
JwksFetcher is reusable so can be used in a wider context.

Tests updated and fixed where necessary.

We are in the process of implementing a new Envoy filter based on the design presented here and wish to re-use existing logic in the jwt_authn filter. We've split out the logic we're interested in into a new class called JwksFetcher. Later PRs will re-use the split out logic an OpenID Connect filter.

This is the second crack at this PR (see #4225 which went horribly wrong after following the DCO rebase guidelines).

Risk Level: Medium
Testing: Add replacement and additional unit tests for the logic that's been moved.

Signed-off-by: Nick A. Smith <nick.a.smith@thales-esecurity.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants