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

fix: remove user credential from keyring #2627

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mslib/mscolab/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.mscolab.models import db, Operation, Permission, User, Change, Message
from mslib.mscolab.conf import mscolab_settings
from mslib.utils.auth import del_password_from_keyring
from mslib.utils.config import config_loader
Copy link
Member

Choose a reason for hiding this comment

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

this won't work,

the config_loader belongs to.the MSUI and this is the application which is installed on the client side.

The server MSCOLAB is on some other location and of course has no idea about the passwords the user has in his machines keyring.

You need to lookup where in the MSUI the Delete Account is used and implement it nearby.

delete_account

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.



class FileManager:
Expand Down Expand Up @@ -233,6 +235,8 @@ def modify_user(self, user, attribute=None, value=None, action=None):
# Delete profile image if it exists
if user.profile_image_path:
self.delete_user_profile_image(user.profile_image_path)
mscolab_server_url = config_loader(dataset="default_MSCOLAB")
del_password_from_keyring(service_name=mscolab_server_url[0], username=user.emailid)
db.session.delete(user)
db.session.commit()
user_query = User.query.filter_by(id=user.id).first()
Expand Down
Loading