Skip to content

Commit

Permalink
Connect distinct accounts per site (#7004)
Browse files Browse the repository at this point in the history
* add PermissionsController

remove provider approval controller
integrate rpc-cap
create PermissionsController
move provider approval functionality to permissions controller
add permissions approval ui, settings page
add permissions activity and history
move some functionality to metamask-inpage-provider
rename siteMetadata -> domainMetadata

add accountsChange notification to inpage provider
move functionality to inpage provider
update inpage provider
Remove 'Connections' settings page (#7369)
add hooks for exposing accounts in settings
rename unused messages in non-English locales

Add external extension id to metadata (#7396)

update inpage provider, rpc-cap
add eth_requestAccounts handling to background
prevent notifying connections if extension is locked
update inpage provider
Fix lint errors
add migration
review fixes
transaction controller review updates
removed unused messages

* Login Per Site UI (#7368)

* LoginPerSite original UI changes to keep

* First commit

* Get necessary connected tab info for redirect and icon display for permissioned sites

* Fix up designs and add missing features

* Some lint fixes

* More lint fixes

* Ensures the tx controller + tx-state-manager orders transactions in the order they are received

* Code cleanup for LoginPerSite-ui

* Update e2e tests to use new connection flow

* Fix display of connect screen and app header after login when connect request present

* Update metamask-responsive-ui.spec for new item in accounts dropdown

* Fix approve container by replacing approvedOrigins with domainMetaData

* Adds test/e2e/permissions.spec.js

* Correctly handle cancellation of a permissions request

* Redirect to home after disconnecting all sites / cancelling all permissions

* Fix display of site icons in menu

* Fix height of permissions page container

* Remove unused locale messages

* Set default values for openExternalTabs and tabIdOrigins in account-menu.container

* More code cleanup for LoginPerSite-ui

* Use extensions api to close tab in permissions-connect

* Remove unnecessary change in domIsReady() in contentscript

* Remove unnecessary private function markers and class methods (for background tab info) in metamask-controller.

* Adds getOriginOfCurrentTab selector

* Adds IconWithFallback component and substitutes for appropriate cases

* Add and utilize font mixins

* Remove unused  method in disconnect-all.container.js

* Simplify buttonSizeLarge code in page-container-footer.component.js

* Add and utilize getAccountsWithLabels selector

* Remove console.log in ui/app/store/actions.js

* Change last connected time format to yyyy-M-d

* Fix css associated with IconWithFallback change

* Ensure tracked openNonMetamaskTabsIDs are correctly set to inactive on tab changes

* Code cleanup for LoginPerSite-ui

* Use reusable function for modifying openNonMetamaskTabsIDs in background.js

* Enables automatic switching to connected account when connected domain is open

* Prevent exploit of tabIdOriginMap in background.js

* Remove unneeded code from contentscript.js

* Simplify current tab origin and window opener logic using remotePort listener tabs.queryTabs

* Design and styling fixes for LoginPerSite-ui

* Fix permissionHistory and permission logging for eth_requestAccounts and eth_accounts

* Front end changes to support display of lastConnected time in connected and permissions screens

* Fix lint errors

* Refactor structure of permissionsHistory

* Fix default values and object modifications for domain and permissionsHistory related data

* Fix connecting to new accounts from modal

* Replace retweet.svg with connect-white.svg

* Fix signature-request.spec

* Update metamask-inpage-provider version

* Fix permissions e2e tests

* Remove unneeded delay from test/e2e/signature-request.spec.js

* Add delay before attempting to retrieve network id in dapp in ethereum-on=.spec

* Use requestAccountTabIds strategy for determining tab id that opened a given window

* Improve default values for permissions requests

* Add some message descriptions to app/_locales/en/messages.json

* Code clean up in permission controller

* Stopped deep cloning object in mapObjectValues

* Bump metamask-inpage-provider version

* Add missing description in app/_locales/en/messages.json

* Return promises from queryTabs and switchToTab of extension.js

* Remove unused getAllPermissions function

* Use default props in icon-with-fallback.component.js

* Stop passing  to permissions controller

* Delete no longer used clear-approved-origins modal code

* Remove duplicate imports in ui/app/components/app/index.scss

* Use URL instead of regex in getOriginFromUrl()

* Add runtime error checking to platform, promise based extension.tab methods

* Support permission requests from external extensions

* Improve font size and colour of the domain origin on the permission confirmation screen

* Add support for toggling permissions

* Ensure getRenderablePermissionsDomains only returns domains with exposedAccount caveat permissions

* Remove unused code from LoginPerSite-ui branch

* Ensure modal closes on Enter press for new-account-modal.component.js

* Lint fix

* fixup! Login Per Site UI (#7368)

* Some code cleanup for LoginPerSite

* Adds UX for connecting to dapps via the connected sites screen (#7593)

* Adds UX for connecting to dapps via the connected sites screen

* Use openMetaMaskTabIds from background.js to determine if current active tab is MetaMask

* Delete unused permissions controller methods

* Fixes two small bugs in the LoginPerSite ui (#7595)

* Restore `providerRequest` message translations (#7600)

This message was removed, but it was replaced with a very similar
message called `likeToConnect`. The only difference is that the new
message has "MetaMask" in it. Preserving these messages without
"MetaMask" is probably better than deleting them, so these messages
have all been restored and renamed to `likeToConnect`.

* Login per site no sitemetadata fix (#7610)

* Support connected sites for which we have no site metadata.

* Change property containing subtitle info often populated by origin to a more accurate of purpose name

* Lint fix

* Improve disconnection modal messages (#7612)

* Improve disconnectAccountModalDescription and disconnectAllModalDescription messages

* Update disconnectAccountModalDescription app/_locales/en/messages.json

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Improve disconnectAccount modal message clarity

* Adds cancel button to the account selection screen of the permissions request flow (#7613)

* Fix eth_accounts permission language & selectability (#7614)

* fix eth_accounts language & selectability

* fix MetaMask capitalization in all messages

* Close sidebar when opening connected sites (#7611)

The 'Connected Sites' button in the accounts details now closes the
sidebar, if it is open. This was accomplished by pulling the click
handler for that button up to the wallet view component, where another
button already followed a similar pattern of closing the sidebar.

It seemed confusing to me that one handler was in the `AccountsDetails`
container component, and one was handed down from above, so I added
PropTypes to the container component.

I'm not sure that the WalletView component is the best place for this
logic, but I've put it there for now to be consistent with the add
token button.

* Reject permissions request upon tab close (#7618)

Permissions requests are now rejected when the page is closed. This
only applies to the full-screen view, as that is the view permission
requests should be handled in. The case where the user deals with the
request through a different view is handled in #7617

* Handle tab update failure (#7619)

`extension.tabs.update` can sometimes fail if the user interacts with
the tabs directly around the same time. The redirect flow has been
updated to ensure that the permissions tab is still closed in that
case. The user is on their own to find the dapp tab again in that case.

* Login per site tab popup fixes (#7617)

* Handle redirect in response to state update in permissions-connect

* Ensure origin is available to permissions-connect subcomponents during redirect

* Hide app bar whenever on redirect route

* Improvements to handling of redirects in permissions-connect

* Ensure permission request id change handling only happens when page is not null

* Lint fix

* Decouple confirm transaction screen from the selected address (#7622)

* Avoid race condtion that could prevent contextual account switching (#7623)

There was a race condition in the logic responsible for switching the
selected account based upon the active tab. It was asynchronously
querying the active tab, then assuming it had been retrieved later.

The active tab info itself was already in the redux store in another
spot, one that is guaranteed to be set before the UI renders. The
race condition was avoided by deleting the duplicate state, and using
the other active tab state.

* Only redirect back to dapp if current tab is active (#7621)

The "redirect back to dapp" behaviour can be disruptive when the
permissions connect tab is not active. The purpose of the redirect was
to maintain context between the dapp and the permissions request, but
if the user has already moved to another tab, that no longer applies.

* Fix JSX style lint errors

* Remove unused state
  • Loading branch information
danfinlay authored Dec 3, 2019
1 parent 2e69f32 commit f519fa1
Show file tree
Hide file tree
Showing 187 changed files with 4,275 additions and 2,713 deletions.
20 changes: 1 addition & 19 deletions app/_locales/am/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "የግላዊነት ኩነት አሁን በንቡር ነቅቷል"
},
"chartOnlyAvailableEth": {
"message": "ቻርት የሚገኘው በ Ethereum አውታረ መረቦች ላይ ብቻ ነው።"
},
"confirmClear": {
"message": "የተፈቀዱ ድረ ገጾችን ለማጥራት እንደሚፈልጉ እርግጠኛ ነዎት?"
},
"contractInteraction": {
"message": "የግንኙነት ተግባቦት"
},
"clearApprovalData": {
"message": "የግላዊነት ውሂብን አጥራ"
},
"reject": {
"message": "አይቀበሉ"
},
"providerRequest": {
"likeToConnect": {
"message": "$1ከመለያዎ ጋር ለመገናኘት ይፈልጋል"
},
"providerRequestInfo": {
"message": "ይህ ድረ ገጽ የእርስዎን መለያ ወቅታዊ አድራሻ ለማየት እየጠየቀ ነው። ምንጊዜም ግንኙነት የሚያደርጉባቸውን ድረ ገጾች የሚያምኗቸው መሆኑን ያረጋግጡ።"
},
"about": {
"message": "ስለ"
},
Expand Down Expand Up @@ -248,9 +236,6 @@
"connect": {
"message": "ይገናኙ"
},
"connectRequest": {
"message": "የግንኙነት ጥያቄ"
},
"connectingTo": {
"message": "ከ $1ጋር መገናኘት"
},
Expand Down Expand Up @@ -368,9 +353,6 @@
"directDepositEtherExplainer": {
"message": "ቀደም ሲል የተወሰነ Ether ካለዎት፣ በአዲሱ ቋትዎ Ether ለማግኘት ፈጣኑ መንገድ ቀጥተኛ ተቀማጭ ነው።"
},
"dismiss": {
"message": "አሰናብት"
},
"done": {
"message": "ተጠናቅቋል"
},
Expand Down
20 changes: 1 addition & 19 deletions app/_locales/ar/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "يتم تمكين وضع الخصوصية الآن بشكل افتراضي"
},
"chartOnlyAvailableEth": {
"message": "الرسم البياني متاح فقط على شبكات إيثيريوم."
},
"confirmClear": {
"message": "هل أنت متأكد من أنك تريد مسح المواقع المعتمدة؟"
},
"contractInteraction": {
"message": "التفاعل على العقد"
},
"clearApprovalData": {
"message": "مسح بيانات الخصوصية"
},
"reject": {
"message": "رفض"
},
"providerRequest": {
"likeToConnect": {
"message": "يرغب $1 في الاتصال بحسابك"
},
"providerRequestInfo": {
"message": "يطلب هذا الموقع حق الوصول لعرض عنوان حسابك الحالي. تأكد دائماً من ثقتك في المواقع التي تتفاعل معها."
},
"about": {
"message": "حول"
},
Expand Down Expand Up @@ -248,9 +236,6 @@
"connect": {
"message": "اتصال"
},
"connectRequest": {
"message": "طلب اتصال"
},
"connectingTo": {
"message": "جارِ الاتصال بـ $1"
},
Expand Down Expand Up @@ -368,9 +353,6 @@
"directDepositEtherExplainer": {
"message": "إذا كان لديك بالفعل بعض الأثير، فإن أسرع طريقة للحصول على الأثير في محفظتك الجديدة عن طريق الإيداع المباشر."
},
"dismiss": {
"message": "رفض"
},
"done": {
"message": "تم"
},
Expand Down
20 changes: 1 addition & 19 deletions app/_locales/bg/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "Режимът на поверителност вече е активиран по подразбиране"
},
"chartOnlyAvailableEth": {
"message": "Диаграмата е достъпна само в мрежи на Ethereum."
},
"confirmClear": {
"message": "Сигурни ли сте, че искате да изчистите одобрените уебсайтове?"
},
"contractInteraction": {
"message": "Взаимодействие с договор"
},
"clearApprovalData": {
"message": "Изчистване на данните за поверителност"
},
"reject": {
"message": "Отхвърляне"
},
"providerRequest": {
"likeToConnect": {
"message": "$1 би искал да се свърже с вашия акаунт"
},
"providerRequestInfo": {
"message": "Този сайт иска достъп за преглед на адреса на текущия ви акаунт. Винаги се уверявайте, че се доверявате на сайтовете, с които взаимодействате."
},
"about": {
"message": "Информация"
},
Expand Down Expand Up @@ -248,9 +236,6 @@
"connect": {
"message": "Свързване"
},
"connectRequest": {
"message": "Свържете заявка"
},
"connectingTo": {
"message": "Свързване с $1"
},
Expand Down Expand Up @@ -368,9 +353,6 @@
"directDepositEtherExplainer": {
"message": "Ако вече имате някакъв етер, най-бързият начин да получите етер в новия си портфейл е чрез директен депозит."
},
"dismiss": {
"message": "Отхвърляне"
},
"done": {
"message": "Готово"
},
Expand Down
20 changes: 1 addition & 19 deletions app/_locales/bn/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "গোপনীয়তার মোড এখন ডিফল্ট হিসাবে সক্রিয় করা আছে"
},
"chartOnlyAvailableEth": {
"message": "শুধুমাত্র Ethereum নেটওয়ার্কগুলিতে চার্ট উপলভ্য। "
},
"confirmClear": {
"message": "আপনি কি অনুমোদিত ওয়েবসাইটগুলি মুছে পরিস্কার করার বিষয়ে নিশ্চিত?"
},
"contractInteraction": {
"message": "কন্ট্র্যাক্ট বাক্যালাপ"
},
"clearApprovalData": {
"message": "গোপনীয়তার ডেটা মুছে পরিস্কার করুন"
},
"reject": {
"message": "প্রত্যাখ্যান"
},
"providerRequest": {
"likeToConnect": {
"message": "$1 আপনার অ্যাকাউন্টের সাথে সংযোগ করতে চায়"
},
"providerRequestInfo": {
"message": "এই সাইটটি আপনার বর্তমান অ্যাকাউন্টের ঠিকানা দেখার অ্যাক্সেসের জন্য অনুরোধ জানাচ্ছে। সবসময় নিশ্চিত হয়ে নেবেন যে আপনি যে সাইটের সাথে যোগাযোগ করছেন সেটি বিশ্বাসযোগ্য কিনা।"
},
"about": {
"message": "সম্পর্কে"
},
Expand Down Expand Up @@ -248,9 +236,6 @@
"connect": {
"message": "সংযুক্ত করুন"
},
"connectRequest": {
"message": "সংযোগের অনুরোধ"
},
"connectingTo": {
"message": " $1 এর সাথে সংযোগ করছে"
},
Expand Down Expand Up @@ -368,9 +353,6 @@
"directDepositEtherExplainer": {
"message": "আপনার ইতিমধ্যে কিছু ইথার থেকে থাকলে আপনার নতুন ওয়ালেটে ইথার পাওয়ার দ্রুততম উপায় হল সরাসরি জমা করা।"
},
"dismiss": {
"message": "খারিজ"
},
"done": {
"message": "সম্পন্ন "
},
Expand Down
22 changes: 2 additions & 20 deletions app/_locales/ca/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "El mode de privacitat ara està activat per defecte"
},
"chartOnlyAvailableEth": {
"message": "Mostra només els disponibles a les xarxes Ethereum."
},
"confirmClear": {
"message": "Estàs segur que vols eliminar totes les pàgines web aprovades?"
},
"contractInteraction": {
"message": "Contractar Interacció"
},
"clearApprovalData": {
"message": "Elimina les dades de privacitat"
},
"reject": {
"message": "Rebutja"
},
"providerRequest": {
"likeToConnect": {
"message": "a $1 li agradaria connectar-se al teu compte"
},
"providerRequestInfo": {
"message": "Aquesta pàgina està demanant accès a la teva adreça"
},
"about": {
"message": "Informació"
},
Expand Down Expand Up @@ -245,9 +233,6 @@
"connect": {
"message": "Connecta"
},
"connectRequest": {
"message": "Sol·licitud de connexió"
},
"connectingTo": {
"message": "Connectant a $1 "
},
Expand Down Expand Up @@ -365,9 +350,6 @@
"directDepositEtherExplainer": {
"message": "Si ja tens una mica d'Ether, la manera més ràpida de posar Ether al teu nou moneder és per dipòsit directe."
},
"dismiss": {
"message": "Omet"
},
"done": {
"message": "Fet"
},
Expand Down Expand Up @@ -687,7 +669,7 @@
"message": "Conectant-te a Ethereum i la web descentralitzada."
},
"metamaskSeedWords": {
"message": "Frase de recuperació de Metamask"
"message": "Frase de recuperació de MetaMask"
},
"metamaskVersion": {
"message": "Versió MetaMask"
Expand Down
9 changes: 0 additions & 9 deletions app/_locales/cs/messages.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"confirmClear": {
"message": "Naozaj chcete vymazať schválené webové stránky?"
},
"clearApprovalData": {
"message": "Jasné údaje o schválení"
},
"reject": {
"message": "Odmítnout"
},
"providerRequestInfo": {
"message": "Níže uvedená doména se pokouší požádat o přístup k API Ethereum, aby mohla komunikovat s blokádou Ethereum. Před schválením přístupu Ethereum vždy zkontrolujte, zda jste na správném místě."
},
"account": {
"message": "Účet"
},
Expand Down
20 changes: 1 addition & 19 deletions app/_locales/da/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "Privatlivstilstand er nu som udgangspunkt aktiveret"
},
"chartOnlyAvailableEth": {
"message": "Skema kun tilgængeligt på Ethereum-netværk."
},
"confirmClear": {
"message": "Er du sikker på, at du vil rydde godkendte hjemmesider?"
},
"contractInteraction": {
"message": "Kontraktinteraktion"
},
"clearApprovalData": {
"message": "Ryd fortrolighedsdata"
},
"reject": {
"message": "Afvis"
},
"providerRequest": {
"likeToConnect": {
"message": "$1 ønsker at forbinde til din konto"
},
"providerRequestInfo": {
"message": "Denne side anmoder om at se din nuværende kontoadresse. Sørg altid for, at du stoler på de sider du interagerer med."
},
"about": {
"message": "Om"
},
Expand Down Expand Up @@ -248,9 +236,6 @@
"connect": {
"message": "Få forbindelse"
},
"connectRequest": {
"message": "Tilslutningsanmodning"
},
"connectingTo": {
"message": "Forbinder til $1"
},
Expand Down Expand Up @@ -368,9 +353,6 @@
"directDepositEtherExplainer": {
"message": "Hvis du allerede har Ether, er den hurtigste måde at få Ether i din nye tegnebog ved direkte indbetaling."
},
"dismiss": {
"message": "Luk"
},
"done": {
"message": "Færdig"
},
Expand Down
20 changes: 1 addition & 19 deletions app/_locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"privacyModeDefault": {
"message": "Der Datenschutzmodus ist jetzt standardmäßig aktiviert"
},
"chartOnlyAvailableEth": {
"message": "Die Grafik ist nur in Ethereum-Netzwerken verfügbar."
},
"confirmClear": {
"message": "Möchten Sie die genehmigten Websites wirklich löschen?"
},
"contractInteraction": {
"message": "Vertragsinteraktion"
},
"clearApprovalData": {
"message": "Genehmigungsdaten löschen"
},
"reject": {
"message": "Ablehnen"
},
"providerRequest": {
"likeToConnect": {
"message": "$1 möchte sich mit deinem Account verbinden"
},
"providerRequestInfo": {
"message": "Diese Website fordert Zugriff auf Ihre aktuelle Kontoadresse. Stellen Sie immer sicher, dass Sie den Websites vertrauen, mit denen Sie interagieren."
},
"about": {
"message": "Über"
},
Expand Down Expand Up @@ -236,9 +224,6 @@
"connect": {
"message": "Verbinden"
},
"connectRequest": {
"message": "Verbindungsanfrage"
},
"connectingTo": {
"message": "Verbindung mit $1 wird hergestellt"
},
Expand Down Expand Up @@ -353,9 +338,6 @@
"directDepositEtherExplainer": {
"message": "Wenn du bereits Ether besitzt, ist die sofortige Einzahlung die schnellste Methode Ether in deine neue Wallet zu bekommen."
},
"dismiss": {
"message": "Schließen"
},
"done": {
"message": "Fertig"
},
Expand Down
Loading

0 comments on commit f519fa1

Please sign in to comment.