Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

feature: use binary keys instead of passwords #55

Merged
merged 7 commits into from
Dec 14, 2017
Merged

feature: use binary keys instead of passwords #55

merged 7 commits into from
Dec 14, 2017

Conversation

linuxwolf
Copy link
Contributor

@linuxwolf linuxwolf commented Nov 14, 2017

Resolves #52

Switches the datastore from using a password-based key to using a binary key (from FxA).

This work is assuming there is no migration from the former model to this new model. It is also providing a path to incorporating an external salt for key derivations; in practice this will be the FxA uid, or a persisted UUID while the system is not bound to an FxA account.

@ghost ghost assigned linuxwolf Nov 14, 2017
@ghost ghost added the in progress We are actively working on it. label Nov 14, 2017
@devinreams
Copy link
Contributor

devinreams commented Dec 4, 2017

@linuxwolf for purposes of releasing mozilla-lockwise/lockbox-extension#362 would you like this reviewed by @jimporter (knowing a broader review is needed from others soon)?

Or do you want to keep this branch and keep the extension pegged to it for now?

Or did you have something else entirely in mind?

@linuxwolf
Copy link
Contributor Author

linuxwolf commented Dec 5, 2017

@jimporter @devinreams This PR should be good to review now.

Or do you want to keep this branch and keep the extension pegged to it for now?

I don't think it's worth keeping separate; does mean PR should land before mozilla-lockwise/lockbox-extension#362 (and that PR updated to point to the shared repo).

Copy link

@jimporter jimporter left a comment

Choose a reason for hiding this comment

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

There are some merge conflicts that snuck into this PR, but otherwise it looks good. It might be worth defining a consistent style for JSDocs though.

lib/datastore.js Outdated
* deriving the master key
* @param {jose.JWK.Key} [opts.appKey] The master app key to setup with
* @param {string} [opts.salt] The salt to use in deriving the master
* keys.

Choose a reason for hiding this comment

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

Micro-nit: no punctuation seems to be the consensus here.

* @readonly
*/
get group() { return instance.get(this).group || ""; }
/**
<<<<<<< HEAD

Choose a reason for hiding this comment

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

Looks like a merge conflict didn't get resolved here.

@@ -77,15 +72,20 @@ class ItemKeyStore {
* a plain Object with the following properties:
*
* * `group` {**String**} The name of the keystore's group
<<<<<<< HEAD

Choose a reason for hiding this comment

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

Another merge conflict here.

.eslintrc.json Outdated
"indent": ["error", 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}],
"linebreak-style": ["error", "unix"],
"no-var": "off",

Choose a reason for hiding this comment

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

What do we need var for? I only see it in a couple places in this diff...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

var is used in the build-utils files, which are also linted.

Choose a reason for hiding this comment

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

Does it need to be var there, and if so, would it be better to just ignore the no-var rule on those lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

node.js still has some issues with let at the top-level. I can go back through those files to fix it, but really rather file a chore for now.

lib/datastore.js Outdated
@@ -84,7 +114,8 @@ class DataStore {
* See {@link datastore.create} for the details of what `{cfg}`
* parameters are supported.
*
* @param {Onject} cfg - The configuration parameters
* @param {Object} cfg - The configuration parameters.

Choose a reason for hiding this comment

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

Nit: The consensus seems to be no hyphen and no punctuation. I don't have a preference for how we do this, but consistency would be nice.

@devinreams devinreams requested a review from jimporter December 7, 2017 20:43
@linuxwolf linuxwolf dismissed jimporter’s stale review December 7, 2017 21:32

latest commits should address review comments

@linuxwolf linuxwolf merged commit 57bae0a into mozilla-lockwise:master Dec 14, 2017
@ghost ghost removed the in progress We are actively working on it. label Dec 14, 2017
@linuxwolf linuxwolf deleted the binkey branch January 16, 2018 18:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants