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

Add flush cache for individual user #3812

Closed
wants to merge 1 commit into from

Conversation

dlin2028
Copy link

@dlin2028 dlin2028 commented Dec 9, 2023

Description

Currently, our system only allows for the invalidation of the entire user authentication cache, which can lead to numerous cache misses and inefficiencies. This change is required to allow for more precise cache management, specifically targeting stale cache entries at the individual user level without disrupting the cache state of other users

  • Category: New feature
  • Why these changes are required?
    Currently, our system only allows for the invalidation of the entire user authentication cache. This change is required to allow for more precise cache management, specifically targeting stale cache entries at the individual user level without disrupting the cache state of other users.
  • What is the old behavior before changes and new behavior after changes?
    Previously, invalidating a user's cache required clearing the entire cache, affecting all users. The new behavior introduces an endpoint that allows for the invalidation of cache entries on a per-user basis, thereby maintaining cache integrity for other users and reducing unnecessary cache misses.

Issues Resolved

#2829

Testing

Unit testing was written in FlushCacheApiTest.java

Check List

  • [X ] New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

@cwperks
Copy link
Member

cwperks commented Dec 12, 2023

@dlin2028 Thank you for the PR. Could you please sign your commits using git commit -m "<message>" --signoff?

Do you think it would be possible to show an example using the integrationTest framework to show a user's roles changing in the IdP and using this endpoint to invalidate and get the latest roles? You can see example of LDAP tests in LdapAuthenticationTest that show how an IdP is configured for test cases.

@cwperks
Copy link
Member

cwperks commented Dec 18, 2023

@dlin2028 Please see cwperks#14 for an example of writing an LDAP test and calling the flush cache API introduced in this PR. I updated the logic a little bit in this PR to ensure that the cache was invalidated on all nodes and not only the node that receives the API request by reusing the transport action for a ConfigUpdateRequest.

@stephen-crawford
Copy link
Collaborator

I am going to close this PR as it is 1 Month+ since any activity. Please feel free to re-open it or open a new PR if you decide to continue to work on this :)

@dlin2028
Copy link
Author

dlin2028 commented May 1, 2024

@scrawfor99 can you please re-open this PR

@DarshitChanpura
Copy link
Member

@dlin2028 If you are planning to continue working on this issue, please open a new PR.

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.

4 participants