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

3138 revoke tokens on logout #3149

Merged
merged 3 commits into from
Mar 24, 2023
Merged

Conversation

VakarisZ
Copy link
Contributor

What does this PR do?

Fixes #3138

Add any further explanations here.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • Any other testing performed?

    Tested by
    logout_revoke

@VakarisZ VakarisZ requested a review from mssalvatore March 24, 2023 13:50
):
self._repository_encryptor = repository_encryptor
self._island_event_queue = island_event_queue
self._datastore = user_datastore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better to use datastore than directly manipulating the database. It will be easier to change if we migrate to another db + less overriding required

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (83557c9) 71.66% compared to head (320bc6e) 71.64%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3149      +/-   ##
===========================================
- Coverage    71.66%   71.64%   -0.03%     
===========================================
  Files          452      453       +1     
  Lines        12852    12864      +12     
===========================================
+ Hits          9210     9216       +6     
- Misses        3642     3648       +6     

see 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -1,3 +1,5 @@
from flask_security import MongoEngineUserDatastore
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything preventing us from using UserDatastore?

@VakarisZ VakarisZ force-pushed the 3138-revoke-tokens-on-logout branch from 4c69d1f to 5700f1d Compare March 24, 2023 14:50
Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

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

Approved, as long as manual testing has been done to ensure authentication is still enforced.

@@ -30,13 +31,20 @@ def mock_island_event_queue(autouse=True) -> IIslandEventQueue:
return MagicMock(spec=IIslandEventQueue)


@pytest.fixture
def mock_user_datastore(autouse=True) -> MongoEngineUserDatastore:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use UserDatastore here, since that's what AuthenticationFacade expects

@VakarisZ VakarisZ force-pushed the 3138-revoke-tokens-on-logout branch from 402e15d to 320bc6e Compare March 24, 2023 15:35
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.

Revoke tokens on logout
3 participants