Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
feat: update password service access presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Feb 18, 2021
1 parent 4c358fc commit a3fa54b
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 67 deletions.
141 changes: 80 additions & 61 deletions app/grantLinuxPasswordsAccess.html
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Grant Standard Notes access to password storage</title>
<title>Standard Notes</title>
<link
rel="stylesheet"
media="all"
Expand All @@ -13,11 +13,13 @@
</head>
<body class="main-ui">
<div class="sk-modal">
<div class="challenge-modal sk-modal-content">
<div class="challenge-modal sk-modal-content" style="margin: 2rem">
<div class="sn-component">
<div class="sk-panel">
<div class="sk-panel-header">
<div class="sk-panel-header-title">Password Manager Access</div>
<div class="sk-panel-header-title capitalize">
Password service access
</div>
</div>
<div class="sk-panel-content" style="padding-bottom: 2rem">
<h1 class="sk-h1">
Expand All @@ -29,8 +31,8 @@ <h1 class="sk-h1">
</p>
<p class="sk-p">
<strong
>Standard Notes currently does not have access to your
password manager.</strong
>Standard Notes currently does not have access to your system
password service.</strong
>
If you grant it access, you must quit the app for the change to
come into effect.
Expand All @@ -39,7 +41,7 @@ <h1 class="sk-h1">
<div class="sk-button-group">
<button class="sk-button info" onclick="quit()">
<div class="sk-label capitalize">
Use password manager (quit)
Use password service (quit)
</div>
</button>
<button
Expand All @@ -51,61 +53,78 @@ <h1 class="sk-h1">
</div>
</div>
<div class="sk-panel-row"></div>
<h1 class="sk-h1">What's the difference?</h1>
<p class="sk-p">
Using local storage, your account keys may be more easily
accessible by third-party programs, unlike in your password
manager which has additional protections built-in.
</p>
<p class="sk-p">
In either cases, the strongest way to protect your account keys
is to use a strong passcode, which will be used to encrypt your
keys and prevent any software or operating system from reading
them.
<strong
>If you plan on setting a passcode, you can safely use local
storage.</strong
>
</p>
<div class="sk-panel-row"></div>
<h2 class="sk-h2">
Granting Standard Notes access to your password manager
</h2>
<p class="sk-p">
Note that
<strong>
granting access to your password manager will allow Standard
Notes to read, write, and delete <em>any</em> of your saved
passwords.</strong
>
Standard Notes will never use this privilege to do anything more
than reading and writing to its own entry.
</p>
<ol>
<li class="sk-li">Quit Standard Notes</li>
<li class="sk-li">
Open your software store (Ubuntu Software Center/Snap Store)
</li>
<li class="sk-li">
In your installed apps list, click on Standard Notes
</li>
<li class="sk-li">Look for a <em>Permissions</em> button</li>
<li class="sk-li">
Make sure the permission associated with reading and writing
passwords is checked
</li>
<li class="sk-li">Open Standard Notes again</li>
</ol>
<h2 class="sk-h2">
Granting Standard Notes access to your password manager from the
terminal
</h2>
<p class="sk-p">
Run the following command:<br />
<code
>snap connect standard-notes:password-manager-service</code
>
</p>
<a class="sk-a capitalize" id="learn-more">Learn more</a>
<div style="display: none" id="more-info">
<div class="sk-panel-section">
<h1 class="sk-h1">What's the difference?</h1>
<p class="sk-p">
Using local storage, your account keys may be more easily
accessible by third-party programs, unlike in your password
manager which has additional protections built-in.
</p>
<p class="sk-p">
In either cases, the strongest way to protect your account
keys is to use a strong passcode, which will be used to
encrypt your keys and prevent any software or operating
system from reading them.
<strong>
If you plan on setting a passcode, you can safely use
local storage.
</strong>
</p>
<div class="sk-panel-row"></div>
<h2 class="sk-h2">
Granting Standard Notes access to your system password
service
</h2>
<p class="sk-p">
Note that
<strong>
granting access to your system password service will allow
Standard Notes to read, write, and delete <em>any</em> of
your saved passwords.
</strong>
Standard Notes will never use this privilege to do anything
more than reading and writing to its own entry.
</p>
<ol>
<li class="sk-li">Quit Standard Notes</li>
<li class="sk-li">
Open your software store (Ubuntu Software Center/Snap
Store)
</li>
<li class="sk-li">
In your installed apps list, click on Standard Notes
</li>
<li class="sk-li">
Look for a <em>Permissions</em> button
</li>
<li class="sk-li">
Make sure the permission associated with reading and
writing passwords is checked
</li>
<li class="sk-li">Open Standard Notes again</li>
</ol>
<h2 class="sk-h2">
Granting Standard Notes access to your system password
service from the command line
</h2>
<p class="sk-p">
Run the following command:<br />
<code
>snap connect
standard-notes:password-manager-service</code
>
</p>
</div>
<p>
<em>
Note: Password Service may also be referred to as keyring,
saved passwords, stored passwords, password manager,
passwords, secrets, depending on your Linux configuration.

This comment has been minimized.

Copy link
@moughxyz

moughxyz Feb 18, 2021

Member

Missing an "or secrets" at the last list item I suppose.

</em>
</p>
</div>
</div>
</div>
</div>
Expand Down
17 changes: 11 additions & 6 deletions app/javascripts/main/keychain.ts
Expand Up @@ -47,9 +47,8 @@ export async function ensureKeychainAccess(

function askForKeychainAccess(store: Store): Promise<BrowserWindow> {
const window = new BrowserWindow({
frame: false,
width: 520,
height: 820,
width: 540,
height: 400,
center: true,
show: false,
webPreferences: {
Expand All @@ -59,15 +58,21 @@ function askForKeychainAccess(store: Store): Promise<BrowserWindow> {
window.on('ready-to-show', window.show);
window.loadURL(grantLinuxPasswordsAccessUrl);

const quitListener = () => {
const quit = () => {
app.quit();
};
ipcMain.once(IpcMessages.Quit, quitListener);
ipcMain.once(IpcMessages.Quit, quit);
window.once('close', quit);

ipcMain.on(IpcMessages.LearnMoreAboutKeychainAccess, () => {
window.setSize(window.getSize()[0], 600, true);
});

return new Promise((resolve) => {
ipcMain.once(IpcMessages.UseLocalstorageForKeychain, () => {
store.set(StoreKeys.UseNativeKeychain, false);
ipcMain.removeListener(IpcMessages.Quit, quitListener);
ipcMain.removeListener(IpcMessages.Quit, quit);
window.removeListener('close', quit);
resolve(window);
});
});
Expand Down
12 changes: 12 additions & 0 deletions app/javascripts/renderer/grantLinuxPasswordsAccess.ts
Expand Up @@ -10,3 +10,15 @@ Object.assign(window, {
ipcRenderer.send(IpcMessages.UseLocalstorageForKeychain);
},
});

document.addEventListener('DOMContentLoaded', () => {
const learnMoreButton = document.getElementById('learn-more')!;
const moreInfo = document.getElementById('more-info')!;

learnMoreButton.addEventListener('click', (event) => {
ipcRenderer.send(IpcMessages.LearnMoreAboutKeychainAccess);
event.preventDefault();
moreInfo.style.display = 'block';
learnMoreButton.style.display = 'none';
});
});
1 change: 1 addition & 0 deletions app/javascripts/shared/ipcMessages.ts
Expand Up @@ -16,4 +16,5 @@ export enum IpcMessages {
ClearKeychainValue = 'ClearKeychainValue',
Quit = 'Quit',
UseLocalstorageForKeychain = 'UseLocalstorageForKeychain',
LearnMoreAboutKeychainAccess = 'LearnMoreAboutKeychainAccess',
}

0 comments on commit a3fa54b

Please sign in to comment.