-
Notifications
You must be signed in to change notification settings - Fork 85
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(secrets): Reduce keychain unlock prompts on MacOS #2394
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Timothy Johnson <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2394 +/- ##
========================================
Coverage 91.28% 91.28%
========================================
Files 638 638
Lines 18208 18208
Branches 3930 3822 -108
========================================
Hits 16621 16621
Misses 1586 1586
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Timothy Johnson <[email protected]>
5ac932d
to
9475e16
Compare
Signed-off-by: Timothy Johnson <[email protected]>
45d2bc0
to
7c0a0d7
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.
Changes make sense to me, thanks for the fix @t1m0thyj - pretty cool that fmutex
leverages the scope of the guard to auto-release the lock 😋
As discussed offline, failing tests are related to glibc
segfault with ava
- once workerThreads: false
is added, the stages will pass. Thanks for looking into this as well!
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
0104a49
to
fadf4e8
Compare
Quality Gate passedIssues Measures |
What It Does
Reduces the number of keychain unlock prompts on MacOS for simultaneous access to secrets by the same process.
As a security feature, MacOS always re-prompts for keychain access after a secret has been modified by another process. This is why after running
zowe config secure
which updates credentials usingnode
, you get a prompt for Zowe Explorer (the VS Code extension host process) to access credentials.Suppose there are 3 VS Code instances open: A, B, and C. Currently when a vault change event is triggered, all 3 instances attempt to access the keychain simultaneously and Mac users will see 3 keychain prompts (ouch).
By adding a mutex associated with the calling process, we can make B & C wait to access credentials until A has finished accessing them. Now Mac users will see just 1 keychain prompt (0 would be ideal but 1 is way better than 3).
How to Test
This PR can only be tested on MacOS since the issue is OS-specific:
keyring.node
artifact and copy it into your ZE prebuilds folder.xattr -d com.apple.quarantine *.node
zowe config secure
command and press Enter repeatedly to skip all prompts.Review Checklist
I certify that I have:
Additional Comments