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

Added IPNS keys settings option #8660

Merged
merged 1 commit into from
May 5, 2021
Merged

Added IPNS keys settings option #8660

merged 1 commit into from
May 5, 2021

Conversation

spylogsster
Copy link
Contributor

@spylogsster spylogsster commented Apr 28, 2021

Second part of brave/brave-browser#15422
First part here #8609

  • Added option to IPFS settings that links to keys management subpage, the option is visible only if local node is enabled
  • Added APIs to add/remove/fetch keys from node, available only on settings page
  • Added observers to switch UI when the node state changed (launch/shutdown)
  • Added automatic redirect if current mode is not local node
  • Added opportunity to launch node if it is stopped
  • Added error indicator if node launch failed. Error message contains the link to open brave://ipfs page for error diagnostic

Normal mode
image

Node is not launched
image

Unable to start node
image

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Go to brave://ipfs and use option to add/remove keys
  • The item to setup IPNS keys should be visible only if current method is local node and the node is launched
  • Try to start/stop node when the add/remove key dialog is opened, the dialog should be closed automatically and the button to start node should be shown
  • Try to open brave://settings/ipfs/keys page when the node is not installed.
    - If current method is local node you should be asked to start the node and see launch error. There's a linked text that can be clicked to navigate to new brave://ipfs tab
    - If current method is not local node you must be redirected to brave://ipfs
  • if you start node from keys page, UIs block to start node and to add keys should be switched automatically

@spylogsster spylogsster requested a review from a team as a April 28, 2021 14:50
@spylogsster spylogsster self-assigned this Apr 28, 2021
@spylogsster spylogsster requested a review from bbondy April 28, 2021 16:04
Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

Things that still need addressing:

  • API Permissions fixing

  • When testing it I noticed that when I reload brave://settings/ipfs and I click on:
    Setup your IPNS keys it does a refresh on the page and doesn't work until I click it a second time.

  • When I was testing it I clicked to add a key but got this in the console Unchecked runtime.lastError: IPFS node is not launched. No error message was displayed though in the page. I didn't have a node installed yet on my local node. We should only show this section when local node is selected in preferences and a node is installed.

  • After it is installed but I restart the browser so the node isn't running, I get Unchecked runtime.lastError: Unable to create key. In this case I think it should start the already installed node.

@spylogsster spylogsster force-pushed the p2p-keys branch 2 times, most recently from f24afaa to c9e1d6a Compare April 28, 2021 23:45
Base automatically changed from p2p-keys to master April 29, 2021 05:48
@spylogsster spylogsster force-pushed the p2p-keys-settings branch 2 times, most recently from a7fedba to ed8de2c Compare April 29, 2021 12:42
@spylogsster
Copy link
Contributor Author

Things that still need addressing:

  • API Permissions fixing
  • When testing it I noticed that when I reload brave://settings/ipfs and I click on:
    Setup your IPNS keys it does a refresh on the page and doesn't work until I click it a second time.
  • When I was testing it I clicked to add a key but got this in the console Unchecked runtime.lastError: IPFS node is not launched. No error message was displayed though in the page. I didn't have a node installed yet on my local node. We should only show this section when local node is selected in preferences and a node is installed.
  • After it is installed but I restart the browser so the node isn't running, I get Unchecked runtime.lastError: Unable to create key. In this case I think it should start the already installed node.

done

@spylogsster spylogsster force-pushed the p2p-keys-settings branch 7 times, most recently from 5149504 to db5fce1 Compare April 29, 2021 16:09
@lidel
Copy link
Contributor

lidel commented Apr 29, 2021

Writing down things from today's sync (could be extracted into separate PRs / issues)

  • Add Import and Export buttons to load/save keypair files via ipfs key import|export
  • Add ability to rotate self key via ipfs key rotate
    • ipfs key rotate -o self.old.FOO may improve UX a bit (FOO could be lat 4 characters of old key)
    • self key rotation could be also added to brave:ipfs page as a privacy feature to "Rotate Peer Identity (PeerID)`

@spylogsster spylogsster force-pushed the p2p-keys-settings branch 4 times, most recently from b1ff9fd to f669d27 Compare May 1, 2021 18:41
@spylogsster spylogsster merged commit 2aa7e1c into master May 5, 2021
@spylogsster spylogsster deleted the p2p-keys-settings branch May 5, 2021 05:28
@spylogsster spylogsster added this to the 1.26.x - Nightly milestone May 5, 2021
@spylogsster spylogsster mentioned this pull request May 5, 2021
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants