Skip to content
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

Allow users to export/import p2p keys #15566

Closed
spylogsster opened this issue Apr 29, 2021 · 3 comments · Fixed by brave/brave-core#8777
Closed

Allow users to export/import p2p keys #15566

spylogsster opened this issue Apr 29, 2021 · 3 comments · Fixed by brave/brave-core#8777

Comments

@spylogsster
Copy link

spylogsster commented Apr 29, 2021

Placeholder for import/export p2p keys

ipfs key export -o ./mykey.key mykey
ipfs key import anotherkey ./mykey.key

add "..." instead of a trash icon for keys and there's a submenu for remove and export keys

@spylogsster spylogsster self-assigned this Apr 29, 2021
@MrCrypticxDev
Copy link

Yeah that seems reasonable.

@spylogsster
Copy link
Author

the export part will be done after ipfs/kubo#8113

@bbondy bbondy added this to the 1.26.x - Nightly milestone May 18, 2021
@stephendonner stephendonner added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label May 27, 2021
@stephendonner
Copy link

stephendonner commented May 27, 2021

Verified PASSED using the testplan from brave/brave-core#8777 with build

Brave 1.26.43 Chromium: 91.0.4472.77 (Official Build) beta (x86_64)
Revision 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS macOS Version 11.4 (Build 20F71)

Check if IPFS import works as expected and files/directories/links are imported well

Steps:

  1. new profile, launch Brave
  2. load ipns://brantly.eth
  3. click on Use a local node
  4. load https://www.wikipedia.org/
  5. context-click on the page and choose Import to IPFS > This page
  6. wait
  7. paste the link from the clipboard; ensured https://dweb.link/ipfs/QmXw6iHkf19YiEpydfUFbK4QegyRzyf1yCVaSEHsLUyMiW?filename=www.wikipedia.org loaded

Confirmed the imported and shared resource loads correctly; more verifications for import were already done over in https://github.com/brave/brave-browser/issues/16020.

Screen Shot 2021-05-27 at 12 34 56 PM

Export keys from node on any computer via ipfs key export -o ./mykey.key mykey command and import it via brave://settings/ipfs/keys

(To save time, I used an exported key given to me by @spylogsster 👍 )

(Import) Steps:

  1. new profile, launch Brave
  2. loaded ipns://brantly.eth
  3. click on Use a local node
  4. loaded brave://settings/ipfs
  5. clicked on Set up your IPNS keys
  6. clicked Add
  7. typed mynewgoodkey and clicked Import
  8. browsed to mykey.key and clicked Import
  9. loaded https://ia801003.us.archive.org/26/items/1941themaltesefalconelhalconmaltesjohnhuston/1941%20-%20The%20Maltese%20Falcon%20-%20El%20halc%C3%B3n%20malt%C3%A9s%20-%20John%20Huston%20-%20VOSE.ogv
  10. context-clicked page and chose Save video as..., clicked Save
  11. clicked the "hamburger" menu and chose Share Local File Using IPFS
  12. chose mynewgoodkey from the flyout menu
  13. chose previously-saved Maltese-Falcon video, chose Open
  14. waited
  15. pasted the copied-to-clipboard link and loaded The Maltest Falcon
  16. compared the file hash to the published-key's hash

Confirmed that they match (...ijwujypbywjd1).

Screen Shot 2021-05-27 at 12 50 58 PM

(Generate/export) Steps:

  1. new profile, launch Brave
  2. loaded ipns://brantly.eth
  3. click on Use a local node
  4. loaded brave://settings/ipfs
  5. clicked on Set up your IPNS keys
  6. clicked Add
  7. typed myexportedkey and clicked Generate
  8. browsed to mykey.key and clicked Open
  9. loaded https://ia801003.us.archive.org/26/items/1941themaltesefalconelhalconmaltesjohnhuston/1941%20-%20The%20Maltese%20Falcon%20-%20El%20halc%C3%B3n%20malt%C3%A9s%20-%20John%20Huston%20-%20VOSE.ogv
  10. context-clicked page and chose Save video as..., clicked Save
  11. clicked the "hamburger" menu and chose Share Local File Using IPFS
  12. chose myexportedkey from the flyout menu
  13. chose previously-saved Maltese-Falcon video, chose Open
  14. waited
  15. pasted the copied-to-clipboard link and loaded The Maltest Falcon
  16. compared the file hash to the published-key's hash

Confirmed they match (...4nhaje1yu1r).

Screen Shot 2021-05-27 at 1 05 33 PM

Check if you try to import anything other than a key file, we alert an error on import attempts

Steps:

  1. new profile, launch Brave
  2. load ipns://brantly.eth
  3. click on Use a local node
  4. downloaded a 10 mb file: http://mirror.sfo12.us.leaseweb.net/speedtest/10mb.bin
  5. loaded brave://settings/ipfs
  6. clicked on Set up your IPNS keys
  7. clicked Add
  8. typed mynewboguskey and clicked Import

Confirmed I got an error message in red: 'mynewboguskey' key import failed beneath Keys available for publishing.

Screen Shot 2021-05-27 at 12 32 33 PM

@stephendonner stephendonner added QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment