-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor FXIOS-10788 [Logins] Apply necessary adjustments for A-S EncryptorDecryptor update #24108
base: main
Are you sure you want to change the base?
Conversation
Adding |
let key = rustKeys.keychain.string(forKey: rustKeys.loginPerFieldKeychainKey) | ||
let encryptedCanaryPhrase = rustKeys.keychain.string(forKey: rustKeys.canaryPhraseKey) | ||
return (key, encryptedCanaryPhrase) |
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.
no need for background call here?
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 had some code before that called getKeychainData
in the background and removed it 😓 Looking at it now, I think it makes sense to keep it in the background still, since I am not sure how compute intensive it is. Good catch !
let rustKeys = RustLoginEncryptionKeys() | ||
let (key, encryptedCanaryPhrase) = getKeychainData(rustKeys: rustKeys) |
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.
let rustKeys = RustLoginEncryptionKeys() | |
let (key, encryptedCanaryPhrase) = getKeychainData(rustKeys: rustKeys) | |
let rustKeys = RustLoginEncryptionKeys() | |
let (key, encryptedCanaryPhrase) = getKeychainData(rustKeys: rustKeys) |
strange indent
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.
Oops 🙃
// This method will be called internally by rust when it needs to encrypt/decrypt logins. | ||
// NOTE: Since this is called internally by rust and each CRUD operation will acquire a mutex lock on the db | ||
// before doing anything we must make sure that getStoredKey is called before doing any CRUD operation in swift. | ||
public func getKey() throws -> Data { |
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.
Note: should put an example somewhere or show how this works for reference
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 call.
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.
Overall looks
This pull request has conflicts when rebasing. Could you fix it @issammani? 🙏 |
9238a45
to
8ee6f31
Compare
3a6e775
to
8ee6f31
Compare
This pull request has conflicts when rebasing. Could you fix it @issammani? 🙏 |
8ee6f31
to
33af679
Compare
@issammani #24265 is the Application Services bump that contains mozilla/application-services#6469 |
eb022e8
to
e7f06db
Compare
30eac48
to
8536b0c
Compare
dc81b9f
to
0ce0fca
Compare
0ce0fca
to
94f9815
Compare
📜 Tickets
Jira ticket
Github issue
💡 Description
This PR:
Login
struct instead ofEncryptedLogin
.LoginEntryFlattened
sinceLoginEntry
is flat in the new implementation.getKey
to implementKeyManager
interface.I ran tests locally and the only failure is not related:
Also tested locally adding/deleting/updating and everything seems to work correctly.
We can only merge this once this PR merges and a new A-S swift component is created. We will need to update the A-S version in this PR as well for BR to pass.
This PR is big enough. I will address other nice-to-haves in follow-ups:
is_empty
forHasSyncedLogins
which doesn't require decryption.has_logins_by_base_domain
for domain search related operations.Deferred<Maybe<...>>()
since it's hard to read and instead use completions.📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)