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

Bugfix status cache #2356

Merged
merged 3 commits into from
Aug 9, 2021
Merged

Conversation

nessiLahav
Copy link
Contributor

What does this PR do?

Fix cache bug in authn-jwt status flow

What ticket does this PR close?

Resolves #[relevant GitHub issues, eg 76]

Checklists

Change log

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR, and/or there is a follow-on issue to update docs, or
  • This PR does not require updating any documentation

API Changes

  • The OpenAPI spec has been updated to meet new API changes (or an issue has been opened), or
  • The changes in this PR do not affect the Conjur API

@nessiLahav nessiLahav self-assigned this Aug 9, 2021
@nessiLahav nessiLahav requested a review from a team as a code owner August 9, 2021 10:55
@nessiLahav nessiLahav force-pushed the bugfix-status-cache branch from fb559fc to 20e4784 Compare August 9, 2021 10:59
@@ -3,6 +3,16 @@ module AuthnJwt

ValidateStatus = CommandClass.new(
dependencies: {
fetch_signing_key: ::Util::ConcurrencyLimitedCache.new(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it worth to align the parameter name in different classes

fetch_signing_key_from_cache: ::Util::ConcurrencyLimitedCache.new(

CC: @tzheleznyak

Copy link
Contributor

Choose a reason for hiding this comment

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

@nessiLahav rebase the bugfix branch to you branch

Comment on lines 108 to 111
def fetch_jwt_claims_to_validate
@fetch_jwt_claims_to_validate ||= ::Authentication::AuthnJwt::ValidateAndDecode::FetchJwtClaimsToValidate.new
end

Copy link
Contributor

Choose a reason for hiding this comment

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

How is it related?

@nessiLahav nessiLahav force-pushed the bugfix-status-cache branch 2 times, most recently from 7cff142 to 7f16dc1 Compare August 9, 2021 12:03
@nessiLahav nessiLahav force-pushed the bugfix-status-cache branch from 7f16dc1 to b1bbbd9 Compare August 9, 2021 12:04
Copy link
Contributor

@sashaCher sashaCher left a comment

Choose a reason for hiding this comment

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

Let it be

@nessiLahav nessiLahav merged commit 2049cee into bugfix-jwt-signing-key-chache Aug 9, 2021
@nessiLahav nessiLahav deleted the bugfix-status-cache branch August 9, 2021 12:07
tzheleznyak added a commit that referenced this pull request Aug 10, 2021
* Fix cache of signing key

* Adjust ValidateAndDecodeToken UTs

* Bugfix status cache (#2356)

* ONYX-11330: Fix cache of signing key

* Fix cache bug in authn-jwt status flow

* Fixes according to PR comments

Co-authored-by: Tamir Zheleznyak <[email protected]>

* Fix signing_key UTs

* Fix by PR comments

Co-authored-by: Sasha Chernomordik <[email protected]>
Co-authored-by: Nessi Lahav <[email protected]>
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