-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP] ABW-1674: Import export profile as file with encryption #670
[WIP] ABW-1674: Import export profile as file with encryption #670
Conversation
Sources/Clients/FactorSourcesClient/FactorSourcesClient+Interface.swift
Outdated
Show resolved
Hide resolved
Sources/Clients/OverlayWindowClient/OverlayWindowClient+Interface.swift
Outdated
Show resolved
Hide resolved
Sources/Features/AccountPreferencesFeature/Children/UpdateAccountLabel+Reducer.swift
Show resolved
Hide resolved
...res/ManageSecurityStructure/Children/Advanced/AdvancedCreateSecurityStructureFlow+View.swift
Outdated
Show resolved
Hide resolved
...ces/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+Reducer.swift
Outdated
Show resolved
Hide resolved
Sources/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+View.swift
Outdated
Show resolved
Hide resolved
Sources/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+View.swift
Outdated
Show resolved
Hide resolved
Sources/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+View.swift
Outdated
Show resolved
Hide resolved
Sources/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+View.swift
Outdated
Show resolved
Hide resolved
Sources/Features/ProfileBackupsFeature/BackupProfileSettings/BackUpProfileSettings+View.swift
Outdated
Show resolved
Hide resolved
...rofileFromBackup/Children/ImportSeedPhrasesFlow/ImportMnemonicControllingAccounts+View.swift
Show resolved
Hide resolved
func path( | ||
for store: StoreOf<RestoreProfileFromBackupCoordinator.Path> | ||
) -> some SwiftUI.View { | ||
SwitchStore(store) { |
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.
You should be able to use the newer version of SwitchStore, where you get a reference to state in the closure, and you can switch on that. Still need to use CaseLet in the cases, but it still forces exhaustivity.
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.
nice! I migrated ALL SwitchStores to this, see: 59c1a4a
@GhenadieVP ping ^^
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.
Great work. Should probably test the Relayed one, I don't fully trust the Relay magic.
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.
Tested all relayed ( TransferAccountList and DappInteractionFlow) and they worked.
...file/Factor/FactorSource+Kinds/SecurityQuestions/SecurityQuestions+KeyDerivationScheme.swift
Show resolved
Hide resolved
...file/Factor/FactorSource+Kinds/SecurityQuestions/SecurityQuestions+KeyDerivationScheme.swift
Outdated
Show resolved
Hide resolved
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.
A work of art, only style comments.
then: { ChooseReceivingAccount.View(store: $0) } | ||
) | ||
SwitchStore(store.relay()) { state in | ||
|
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.
Extra space
Jira ticket: ABW-1674
All exported files are JSON files, if profile snapshot is plaintext, it is just the JSON encoding of the snapshot saved as a .json file, if encryption is used then this json file is saved:
The Swift model looks like this:
We are versioning KDF and encryption!! And that has been encapsulated in full by the types
KeyDerivationScheme
andEncryptionScheme
, which when coded contains aversion
and adescription
property. Onlyversion
is used during decryption, but thedescription
is useful nonetheless.N.B.
The KDF and encryption used for profile snapshot is/will NOT be the same for
SecurityQuestionsFactorSource
!!! Which will use a much more complicated scheme (which should also be versioned...).Example
Here follows to examples of file based manually exported profiles, one encrypted and one plaintext. Both are identical (once the encrypted have been decrypted...). Below is the mnemonics for them:
Mnemonics
Encrypted
The encryption password is
File
(apparently I cannot upload JSON files to Github - wtf... so uploading them to Slack)
See encrypted file here on Slack
Plaintext
(apparently I cannot upload JSON files to Github - wtf... so uploading them to Slack)
See plaintext Profile file here on Slack
Pro-Tip: For DEBUG build under Advanced Mode in Import Mnemonic screen you can copy paste the mnemoncs...
Video
Updated video/demo from Wednesday 23rd of August: https://rdxworks.slack.com/archives/C031A0V1A1W/p1692798080432219
PR submission checklist