-
Notifications
You must be signed in to change notification settings - Fork 792
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
Conversation
monkey/monkey_island/cc/services/authentication_service/authentication_facade.py
Show resolved
Hide resolved
): | ||
self._repository_encryptor = repository_encryptor | ||
self._island_event_queue = island_event_queue | ||
self._datastore = user_datastore |
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.
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 ReportPatch coverage has no change and project coverage change:
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. |
@@ -1,3 +1,5 @@ | |||
from flask_security import MongoEngineUserDatastore |
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.
Is there anything preventing us from using UserDatastore
?
4c69d1f
to
5700f1d
Compare
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.
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: |
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.
We can use UserDatastore
here, since that's what AuthenticationFacade
expects
402e15d
to
320bc6e
Compare
If the encryptor is locked on logout it means agents will fail as soon as user logs out
320bc6e
to
5464788
Compare
What does this PR do?
Fixes #3138
Add any further explanations here.
PR Checklist
Testing Checklist