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

Check if keyring is unlocked before setting password #607

Merged
merged 52 commits into from
Dec 16, 2020
Merged

Check if keyring is unlocked before setting password #607

merged 52 commits into from
Dec 16, 2020

Conversation

samuel-w
Copy link
Contributor

@samuel-w samuel-w commented Sep 3, 2020

I need someone to test the macOS keyring. Should display Please unlock your password manager. if locked, nothing if unlocked when adding a repository. I have no idea whether it will work or not since I don't have a mac to test it on.

Could still break since lock check happens a few seconds before adding a repository, but I think this covers most cases. The only way to fix it would be to set the password and then delete it if the action failed which is a bit clunky and could result in data loss. Just don't lock the keyring in the 10 seconds it takes to add a repo.

Fixes #606

@m3nu
Copy link
Contributor

m3nu commented Sep 3, 2020

Volunteer here. 👋

@m3nu m3nu self-assigned this Sep 3, 2020
@m3nu
Copy link
Contributor

m3nu commented Sep 4, 2020

macOS already shows a prompt to unlock the keychain. So I only got the new message when adding a new repo, not an existing one. Still OK to add this check, as it's common with keychains.

Screen Shot 2020-09-04 at 19 33 33

@samuel-w
Copy link
Contributor Author

samuel-w commented Sep 4, 2020

It's only should pop up if you dismiss the keyring unlock prompt.

The goal is to prevent set password from running with a locked keyring as in that case it would not write the password and could crash things.

@samuel-w samuel-w marked this pull request as ready for review September 5, 2020 20:57
@codecov-io
Copy link

codecov-io commented Nov 28, 2020

Codecov Report

Merging #607 (6c2c070) into master (19b4946) will decrease coverage by 0.45%.
The diff coverage is 42.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #607      +/-   ##
==========================================
- Coverage   74.48%   74.03%   -0.46%     
==========================================
  Files          53       53              
  Lines        3422     3428       +6     
==========================================
- Hits         2549     2538      -11     
- Misses        873      890      +17     
Impacted Files Coverage Δ
src/vorta/borg/init.py 75.00% <ø> (-0.87%) ⬇️
src/vorta/keyring/secretstorage.py 37.14% <12.50%> (-6.86%) ⬇️
src/vorta/borg/borg_thread.py 78.91% <33.33%> (-1.21%) ⬇️
src/vorta/borg/info.py 25.58% <40.00%> (-1.92%) ⬇️
src/vorta/keyring/abc.py 87.50% <71.42%> (-5.10%) ⬇️
src/vorta/keyring/darwin.py 94.59% <81.81%> (-5.41%) ⬇️
src/vorta/keyring/db.py 100.00% <100.00%> (ø)
src/vorta/borg/version.py 33.33% <0.00%> (-3.51%) ⬇️
src/vorta/borg/extract.py 25.00% <0.00%> (-3.00%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19b4946...6c2c070. Read the comment docs.

@samuel-w
Copy link
Contributor Author

Is this good to go?

@m3nu
Copy link
Contributor

m3nu commented Nov 29, 2020

This overlaps with #550. So let's merge that first and then rebase to avoid any conflicts.

@m3nu
Copy link
Contributor

m3nu commented Nov 29, 2020

After that I'll test on macOS. Though most changes are for Linux. Locked keychains are possible, but very unusual for the main login keychain in macOS.

@m3nu m3nu merged commit 7bff91f into borgbase:master Dec 16, 2020
@samuel-w samuel-w deleted the LockedPassword branch December 16, 2020 04:56
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.

When adding a repo, setting password fails without feedback when password manager is locked
3 participants