Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

move muon extension constants into js/constants #9585

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {getExtensionsPath, getBraveExtUrl, getBraveExtIndexHTML} = require('../js
const {getSetting} = require('../js/settings')
const settings = require('../js/constants/settings')
const extensionStates = require('../js/constants/extensionStates')
const {passwordManagers, extensionIds} = require('../js/constants/passwordManagers')
const {passwordManagers, extensionIds, publicKeys} = require('../js/constants/passwordManagers')
const appStore = require('../js/stores/appStore')
const extensionState = require('./common/state/extensionState')
const appActions = require('../js/actions/appActions')
Expand Down Expand Up @@ -473,50 +473,50 @@ module.exports.init = () => {

let registerComponents = (diff) => {
if (getSetting(settings.PDFJS_ENABLED)) {
registerComponent(config.PDFJSExtensionId)
registerComponent(config.PDFJSExtensionId, config.PDFJSExtensionPublicKey)
} else {
disableExtension(config.PDFJSExtensionId)
}

const activePasswordManager = getSetting(settings.ACTIVE_PASSWORD_MANAGER)
if (activePasswordManager === passwordManagers.ONE_PASSWORD) {
registerComponent(extensionIds[passwordManagers.ONE_PASSWORD])
registerComponent(extensionIds[passwordManagers.ONE_PASSWORD], publicKeys[passwordManagers.ONE_PASSWORD])
} else {
disableExtension(extensionIds[passwordManagers.ONE_PASSWORD])
}

if (activePasswordManager === passwordManagers.DASHLANE) {
registerComponent(extensionIds[passwordManagers.DASHLANE])
registerComponent(extensionIds[passwordManagers.DASHLANE], publicKeys[passwordManagers.DASHLANE])
} else {
disableExtension(extensionIds[passwordManagers.DASHLANE])
}

if (activePasswordManager === passwordManagers.LAST_PASS) {
registerComponent(extensionIds[passwordManagers.LAST_PASS])
registerComponent(extensionIds[passwordManagers.LAST_PASS], publicKeys[passwordManagers.LAST_PASS])
} else {
disableExtension(extensionIds[passwordManagers.LAST_PASS])
}

if (activePasswordManager === passwordManagers.ENPASS) {
registerComponent(extensionIds[passwordManagers.ENPASS])
registerComponent(extensionIds[passwordManagers.ENPASS], publicKeys[passwordManagers.ENPASS])
} else {
disableExtension(extensionIds[passwordManagers.ENPASS])
}

if (activePasswordManager === passwordManagers.BITWARDEN) {
registerComponent(extensionIds[passwordManagers.BITWARDEN])
registerComponent(extensionIds[passwordManagers.BITWARDEN], publicKeys[passwordManagers.BITWARDEN])
} else {
disableExtension(extensionIds[passwordManagers.BITWARDEN])
}

if (getSetting(settings.POCKET_ENABLED)) {
registerComponent(config.PocketExtensionId)
registerComponent(config.PocketExtensionId, config.PocketExtensionPublicKey)
} else {
disableExtension(config.PocketExtensionId)
}

if (getSetting(settings.VIMIUM_ENABLED)) {
registerComponent(config.vimiumExtensionId)
registerComponent(config.vimiumExtensionId, config.vimiumExtensionPublicKey)
} else {
disableExtension(config.vimiumExtensionId)
}
Expand All @@ -534,7 +534,7 @@ module.exports.init = () => {
}

if (appStore.getState().getIn(['widevine', 'enabled'])) {
registerComponent(config.widevineComponentId)
registerComponent(config.widevineComponentId, config.widevineComponentPublicKey)
}
}

Expand Down
17 changes: 16 additions & 1 deletion js/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,32 @@ module.exports = {
authUrl: (userId) => `${vaultHost}/v1/users/${userId}`,
replacementUrl: adHost
},
widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek',
widevineComponentPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmhe+02cLPPAViaevk/fzODKUnb/ysaAeD8lpE9pwirV6GYOm+naTo7xPOCh8ujcR6Ryi1nPTq2GTG0CyqdDyOsZ1aRLuMZ5QqX3dJ9jXklS0LqGfosoIpGexfwggbiLvQOo9Q+IWTrAO620KAzYU0U6MV272TJLSmZPUEFY6IGQIDAQAB',
braveExtensionId: 'mnojpmjdmbbfmejpflffifhffcmidifd',
torrentExtensionId: 'fmdpfempfmekjkcfdehndghogpnpjeno',
syncExtensionId: 'cjnmeadmgmiihncdidmfiabhenbggfjm',
// PDFJS
// Parent repo: https://github.com/diracdeltas/pdf.js
// Run: gulp run chromium
// Use Chromium to package build/chormium with the brave private key for pdfjs.
// We maintain our own private keyask bcrypt or bbondy.
PDFJSExtensionId: 'jdbefljfgobbmcidnmpjamcbhnbphjnb',
PDFJSExtensionPublicKey: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqmqh6Kxmj00IjKvjPsCtw6g2BHvKipjS3fBD0IInXZZ57u5oZfw6q42L7tgWDLrNDPvu3XDH0vpECr+IcgBjkM+w6+2VdTyPj5ubngTwvBqCIPItetpsZNJOJfrFw0OIgmyekZYsI+BsK7wiMtHczwfKSTi0JKgrwIRhHbEhpUnCxFhi+zI61p9jwMb2EBFwxru7MtpP21jG7pVznFeLV9W9BkNL1Th9QBvVs7GvZwtIIIniQkKtqT1wp4IY9/mDeM5SgggKakumCnT9D37ZxDnM2K13BKAXOkeH6JLGrZCl3aXmqDO9OhLwoch+LGb5IaXwOZyGnhdhm9MNA3hgEwIDAQAB',
// Pocket
// Download: https://clients2.google.com/service/update2/crx?response=redirect&prodversion=52.0.2743.116&x=id%3Dniloccemoadcdkdjlinkgdfekeahmflj%26uc // NOLINT
PocketExtensionId: 'niloccemoadcdkdjlinkgdfekeahmflj',
PocketExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKCQwBisK1UcxYMn6MAfDbc8yXWzvbnCzqJwjwbeMaAHji91jdCy3bEzMprTZxW/1Anfk9B4P+hcoTwqUaMUB4WemQMRKRsr9vC45V1iv912nqyGkoGT+cRKZc+niBriAnn4J2GBACHJqkkCiSChphDFt/UNoQEKz4VoqWZDVj/QIDAQAB',
// Vimium
// Download: https://clients2.google.com/service/update2/crx?response=redirect&prodversion=52.0.2743.116&x=id%3Ddbepggeogbaibhgnhhndojpepiihcmeb%26uc // NOLINT
vimiumExtensionId: 'dbepggeogbaibhgnhhndojpepiihcmeb',
vimiumExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCavizCZ9EnBGbtcRmMErcaxD2WUHJ9ME8IYGQhUBlFgIvchJjAO8koyak3AM95dqu3sOLdtIYD+75T82V1Wl5fLnHAeij2/IWL2VViTHeZhXZl1+rD9sRDaEYd7aZetpJ29+XXfhVphKArCCfwbYCtoJhTIr6S6DYsXuRevoV0EwIDAQAB',
// Honey
// Download: https://clients2.google.com/service/update2/crx?response=redirect&prodversion=52.0.2743.116&x=id%3Dbmnlcjabgnpnenekpadlanbbkooimhnj%26uc // NOLINT
honeyExtensionId: 'bmnlcjabgnpnenekpadlanbbkooimhnj',
honeyExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC79mayLyuCYY/dyT7Ycr1sVBp9yHrY4mnogVEgu+sDT6+/A121Na+aTw6mFLD6LHgbgHt4fnQ2V/QwcfBSXRTSkGpgNsZAjnYs4/XzZQYKGltWT93EP9zXN1kGbtzfkPGzTakquCfOjbKtbAQKWh8ppzqLhWcRUn9g/PhU99F29QIDAQAB',
pinterestExtensionId: 'gpdjojdkbbmdfjfahjcgigfpmkopogic',
pinterestExtensionPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB95q2hyt49ZDuVnYI91XaZhqQkbXu0X3fzoNxPxhFbfqGKwtts90LJ7lD5DCIfnBg8WGFhp3eW4GxOglAKrnksmJoyAD5PnSAufx8fD3trZvo/ZAqFx1x5Xm3Rm34EgvVXdralgHSYiqcEU/FX3kYnLLhr2TS4lcrsn1KZd/lcQIDAQAB',
widevineComponentId: 'oimompecagnajdejgnnjijobebaeigek',
coinbaseOrigin: 'https://buy.coinbase.com',
newtab: {
fallbackImage: {
Expand Down
10 changes: 10 additions & 0 deletions js/constants/passwordManagers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ displayNames[passwordManagers.ENPASS] = 'Enpass'
displayNames[passwordManagers.BITWARDEN] = 'bitwarden'
displayNames[passwordManagers.UNMANAGED] = null

let publicKeys = {}
publicKeys[passwordManagers.BUILT_IN] = null
publicKeys[passwordManagers.ONE_PASSWORD] = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCB4Mf0xWDqstptZh7gqocHL+RT36ZJo/iJ0kZmLyC8vxCsGS26Loidt69KPBVlfuBI0FaWL25NVB2sVdj7wNsCvQIn7ImQwSB5Audq2B3uQzk70RA7SmGE9ndIKsKs4L19n8avhg4ohejyBiI5nrUegs94i0tMpFVeedmTOO4+eQIDAQAB'
publicKeys[passwordManagers.DASHLANE] = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArf+Mb0ro41bJ+FURIhp7YhwTyaP1UbJY2pMApYFTnl1F++bW65Zf80pwIRFt4b6VUQ7qt3kNE3XWrN5VUpbO5pasQZLk4czaEJzFBGPsxFfe89guXb2Xd6CGAHpfdn+wPIU8hMie0ajoUqIC+YWjEZJ0vf3lP0r9EpEbPUSCdg1SjvLb/NzNzq2h/Eev/BfcrEZ7e3wEb9NgM2/pdP2tfowmBg6xLuoiUz2TaQbTVoBRgmkpik3gy4KojFaHgdidT7AVGIpmHZycEd491E9MG/mHuQ0nWZD9pJOp9n1dBHA4LAq5WxU6f/K+h+qhekWO7KVK0M3/mwxxGhizPbjpJQIDAQAB'
publicKeys[passwordManagers.LAST_PASS] = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiL9y2jziKp5kjb13uYG1bAXsuemUKAYUAwR/N9qTuhMIuly02Ecm63dOkn+M2r26IGfDE/lbPv/dB/W+d34pqGo5uJJY+Omt9t3xsIuz7mQwuvF1H5ozj0OHok5XDFRaBIfPa06RhQw3M7sSZJvQ+qqD3+dr0aLX+mvi0LQ11uQIDAQAB'
publicKeys[passwordManagers.ENPASS] = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhFoAKtOOPY0X3R4soa2r8x3Gy/n23XC/Dn+iTAKR1P1tWgp4pmf1J1l0jI3rYGiVc5ATlawwCgVp5Z1l1PVAEdKmDtHQjbHr5Hwb6W86xwWz+ru2usxVMHcfQlUJdFPKuxValknC4V3XayU9cH+/mo1RCSAfTCKWgqCA2efxK52+FsStwjR9/qjUnVJOGqS0EQmhIfwhdDMpea0XZ67FkTJbRb7wtC6MjIBEcWKvPztpge/vMoyhiLjTckq5kKBbgENOuZe7PvymwWxD0J0ZVfDE6VNQaV7Pkbx9werteHzoAYdSXdj5MKIhL029/zVn3BpCkpEZBr+M2ZXXotEAiwIDAQAB'
publicKeys[passwordManagers.BITWARDEN] = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmqKbvreshyXRuN2gikeR1idqR6KL0Di89JZcMyD4bjJRZVmQO7aznSGSALIHzSAUGYocUYBNDOP5QAhImxXyQ1qG8+goXs93v9GzrNJETdVuCEhqBggC4/DFabryJZDiKvZ2Jl0DM7MsWdoybZPwrj70V3aJ/nVNOMkf868scNTMliwitCqqjT5baTANsG0DkZWQExD4lSXzSZHH9MEO8q0iZ7RRlNuGRBAkZgNV8FwZRsPKm/rwQ9dy3VpgLcmLp5GiMt+kAEncqKAkuRYnhVXXBsKqIyYTMjHSLkLnpfFySyOPLBdS617i/PGNiP/MT6Xy6z//v5NozUgaAZ4gJQIDAQAB'
publicKeys[passwordManagers.UNMANAGED] = null

const thirdPartyPasswordManagers = Object.keys(extensionIds)
.map(key => key && extensionIds[key])
.filter(key => key !== null)
Expand All @@ -41,5 +50,6 @@ module.exports = {
defaultPasswordManager,
extensionIds,
displayNames,
publicKeys,
thirdPartyPasswordManagers
}