-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Chore/credential migration #2562
base: master
Are you sure you want to change the base?
Conversation
Thanks, I think this approach looks good generally. I haven't fully tested this yet, but a couple of initial comments:
|
Thanks for the feedback, I missed those first 2 points you mentioned 😅 Let me know if I need to make more improvements! |
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.
I left some more comments. Let me know if I read something incorrectly!
Due to the typo in ipc.handle
, this branch actually crashes on launch when I try to run it. In addition to the comments, could you please make sure to test this on some passwords/sites of your own and confirm that everything works?
@@ -48,11 +48,11 @@ const passwordCapture = { | |||
}, | |||
handleRecieveCredentials: function (tab, args, frameId) { | |||
var domain = args[0][0] |
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.
Shouldn't we be saving an origin or a URL into currentDomain
(which later gets passed to saveCredential
)? With this way, I think we're not recording the protocol.
In my branch I addressed this by passing the entire URL into the manager: master...password-url-matching#diff-dfe869359e479c9fd76fbe8e10c5f46545b3ec71d7a029aafd096869489da6ed
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.
In the passwordFill.js we pass the origin
part of the url instead of the hostname
which will give us the whole base url https://sub.example.com
and that should be sufficient for the saveCredential
funtionality.
Maybe the domain
variable name is a little confusing, perhaps it needs to be something like urlBase
or urlOrigin
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.
Got it, sorry for the delay. It sounds like something with "origin" would be a better name then.
js/passwordManager/keychain.js
Outdated
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.
We need to change saveCredential
, right? As I mentioned in the comment on passwordCapture
, it's only recording a domain still.
I think we should pass the whole URL into the manager, and then let the manager parse and save the origin: master...password-url-matching#diff-cead69e9db343b1d609e235d95b2610037795876bcd42860ebb620b78d9fa7ecR47
return { | ||
username: credential.username, | ||
password: credential.password, | ||
url: new URL(historyEntry.url).origin |
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.
The name of this field is domain
in the import in keychain.js, so it needs to use the same name here. Or we could rename the field everywhere to origin
, since that matches the new definition better.
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.
Good catch, we could migrate it to be url
so we align with the other browsers' default?
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.
Sure, if you want to update the code to actually save the entire URL, that's fine too. If you want to just save the origin, then we should call the field origin
.
return { | ||
username: credential.username, | ||
password: credential.password, | ||
url: newUrl |
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.
Same thing here: The name of this field is domain
in the import in keychain.js, so it needs to use the same name here.
New version of storing the credentials. Allows for storing the whole URL including, protocols and all subdomains.
The Migrator will run on startup check the version of the built-in store and updates the credentials to the new format if necessary.
For the migration it will
The same is done for the credentials that should never be saved
I've used the
origin
property of the URL since this one gives us the whole 'base' url so we don't need extra fields to save the protocol and subdomains.