Skip to content

Conversation

@montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Aug 28, 2023

Explanation

Adds a new controller, accounts-controller that introduces the InternalAccount model. The InternalAccount will be used to represent accounts instead of an ethereum address.

@metamask/accounts-controller

  • ADDED: Initial release

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@socket-security
Copy link

socket-security bot commented Aug 28, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/snaps-controllers 1.0.1 None +0 669 kB metamaskbot
@metamask/snaps-utils 1.0.1 filesystem, environment +0 355 kB metamaskbot
@metamask/keyring-api 0.2.5 eval, network, filesystem +108 27.9 MB metamaskbot
@types/readable-stream 2.3.15 None +0 24.6 kB types

@socket-security
Copy link

socket-security bot commented Aug 28, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: @metamask/object-multiplex@1.2.0, extension-port-stream@2.1.1, validate-npm-package-name@5.0.0, string_decoder@1.0.3, webextension-polyfill-ts@0.25.0, readable-web-to-node-stream@3.0.2, detect-browser@5.3.0, pump@2.0.1, pump@3.0.0, webextension-polyfill@0.10.0, webextension-polyfill@0.7.0, is-gzip@1.0.0, rfdc@1.3.0, pumpify@1.5.1, peek-stream@1.1.3, duplexify@3.7.1, stream-shift@1.0.1, browserify-zlib@0.1.4, strnum@1.0.5, @metamask/types@1.1.0, stream-browserify@3.0.0, end-of-stream@1.4.4, gunzip-maybe@1.4.2, is-deflate@1.0.0, fs-constants@1.0.0, concat-stream@2.0.0, @metamask/snaps-execution-environments@1.0.1

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@montelaidev
Copy link
Contributor Author

@metamaskbot publish-preview

@montelaidev montelaidev marked this pull request as ready for review September 5, 2023 16:31
@montelaidev montelaidev requested a review from a team as a code owner September 5, 2023 16:39
@montelaidev
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "1.0.0-preview.c5136a4",
  "@metamask-previews/address-book-controller": "3.1.1-preview.c5136a4",
  "@metamask-previews/announcement-controller": "4.0.1-preview.c5136a4",
  "@metamask-previews/approval-controller": "3.5.1-preview.c5136a4",
  "@metamask-previews/assets-controllers": "11.1.0-preview.c5136a4",
  "@metamask-previews/base-controller": "3.2.1-preview.c5136a4",
  "@metamask-previews/composable-controller": "3.0.1-preview.c5136a4",
  "@metamask-previews/controller-utils": "4.3.2-preview.c5136a4",
  "@metamask-previews/ens-controller": "4.1.1-preview.c5136a4",
  "@metamask-previews/gas-fee-controller": "6.1.2-preview.c5136a4",
  "@metamask-previews/keyring-controller": "7.4.0-preview.c5136a4",
  "@metamask-previews/logging-controller": "1.0.1-preview.c5136a4",
  "@metamask-previews/message-manager": "7.3.1-preview.c5136a4",
  "@metamask-previews/name-controller": "1.0.0-preview.c5136a4",
  "@metamask-previews/network-controller": "12.1.2-preview.c5136a4",
  "@metamask-previews/notification-controller": "3.1.1-preview.c5136a4",
  "@metamask-previews/permission-controller": "4.1.1-preview.c5136a4",
  "@metamask-previews/phishing-controller": "6.0.1-preview.c5136a4",
  "@metamask-previews/preferences-controller": "4.4.0-preview.c5136a4",
  "@metamask-previews/rate-limit-controller": "3.0.1-preview.c5136a4",
  "@metamask-previews/selected-network-controller": "1.0.0-preview.c5136a4",
  "@metamask-previews/signature-controller": "5.3.1-preview.c5136a4",
  "@metamask-previews/transaction-controller": "10.0.0-preview.c5136a4"
}

"typescript": "~4.6.3"
},
"peerDependencies": {
"@metamask/keyring-controller": "^7.4.0"
Copy link
Member

Choose a reason for hiding this comment

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

We can probably remove this and leave it in devDependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we can remove the peerDependencies. Changed in 2c2fa52

Copy link
Member

@mikesposito mikesposito Sep 21, 2023

Choose a reason for hiding this comment

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

I might have given a wrong suggestion here:
Seeing how we use messenger events/actions types in other packages, we usually include the package they come from in dependencies and peerDependencies, probably to ensure that we use the same versions of that package across the dep tree

@Gudahtt might have more insights on this, but I think we should rollback these changes - sorry about that.

Copy link
Contributor Author

@montelaidev montelaidev Sep 21, 2023

Choose a reason for hiding this comment

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

no problem, the change has been rolled back in d5e3b8e

@montelaidev
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "0.0.0-preview.d5e3b8e",
  "@metamask-previews/address-book-controller": "3.1.1-preview.d5e3b8e",
  "@metamask-previews/announcement-controller": "4.0.1-preview.d5e3b8e",
  "@metamask-previews/approval-controller": "3.5.1-preview.d5e3b8e",
  "@metamask-previews/assets-controllers": "11.1.0-preview.d5e3b8e",
  "@metamask-previews/base-controller": "3.2.1-preview.d5e3b8e",
  "@metamask-previews/composable-controller": "3.0.1-preview.d5e3b8e",
  "@metamask-previews/controller-utils": "4.3.2-preview.d5e3b8e",
  "@metamask-previews/ens-controller": "4.1.1-preview.d5e3b8e",
  "@metamask-previews/gas-fee-controller": "6.1.2-preview.d5e3b8e",
  "@metamask-previews/keyring-controller": "7.4.0-preview.d5e3b8e",
  "@metamask-previews/logging-controller": "1.0.1-preview.d5e3b8e",
  "@metamask-previews/message-manager": "7.3.1-preview.d5e3b8e",
  "@metamask-previews/name-controller": "1.0.0-preview.d5e3b8e",
  "@metamask-previews/network-controller": "12.1.2-preview.d5e3b8e",
  "@metamask-previews/notification-controller": "3.1.1-preview.d5e3b8e",
  "@metamask-previews/permission-controller": "4.1.1-preview.d5e3b8e",
  "@metamask-previews/phishing-controller": "6.0.1-preview.d5e3b8e",
  "@metamask-previews/preferences-controller": "4.4.0-preview.d5e3b8e",
  "@metamask-previews/rate-limit-controller": "3.0.1-preview.d5e3b8e",
  "@metamask-previews/selected-network-controller": "1.0.0-preview.d5e3b8e",
  "@metamask-previews/signature-controller": "5.3.1-preview.d5e3b8e",
  "@metamask-previews/transaction-controller": "10.0.0-preview.d5e3b8e"
}

Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

Just one more question
Other than that, looks good!

Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@montelaidev montelaidev merged commit 40f7890 into main Sep 21, 2023
@montelaidev montelaidev deleted the feat/accounts-controller branch September 21, 2023 11:33
@legobeat
Copy link
Contributor

@montelaidev What do you think about moving repos for this package for the time being? 🤔

#1699

MajorLift pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

Adds a new controller, `accounts-controller` that introduces the
`InternalAccount` model. The InternalAccount will be used to represent
accounts instead of an ethereum address.

### `@metamask/accounts-controller`
- **ADDED**: Initial release

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Daniel Rocha <68558152+danroc@users.noreply.github.com>
Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

Adds a new controller, `accounts-controller` that introduces the
`InternalAccount` model. The InternalAccount will be used to represent
accounts instead of an ethereum address.

### `@metamask/accounts-controller`
- **ADDED**: Initial release

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Daniel Rocha <68558152+danroc@users.noreply.github.com>
Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants