Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #442 from mozilla/rfk/config-scrypt-helper-url
Simplest possible patch to make scrypt-helper URL configurable.
  • Loading branch information
rfk committed Dec 17, 2013
2 parents 3b36f23 + 5744882 commit 1337b5025e7cbb848a2d03dc97b967c3f309eac0
Showing with 14 additions and 2 deletions.
  1. +4 −0 bin/client_helper.js
  2. +2 −1 client/keystretch.js
  3. +8 −1 config/config.js
@@ -4,7 +4,11 @@

const config = require('../config').root()
const Client = require('../client')
const keystretch = require('../client/keystretch')

// Monkey-patch Client lib to use configurable SCRYPT_HELPER url.
// This is awful but the whole thing is going to go away soon...
keystretch.SCRYPT_HELPER = config.scryptHelper.url

process.on('message', function (message) {
if (message.action === 'crash') {
@@ -37,7 +37,7 @@ function derive(email, password, saltHex) {
.then(
function(K1) {
// request a hash from scrypt based on the first key
return scrypt.hash(K1, KW("scrypt"), SCRYPT_HELPER)
return scrypt.hash(K1, KW("scrypt"), module.exports.SCRYPT_HELPER)
}
)
.then(
@@ -120,5 +120,6 @@ function KW(name) {
return Buffer(NAMESPACE + name)
}

module.exports.SCRYPT_HELPER = SCRYPT_HELPER
module.exports.derive = derive
module.exports.xor = xor
@@ -130,11 +130,18 @@ module.exports = function (fs, path, url, convict) {
},
contentServer: {
url: {
doc: "Thes url of the correspoding fxa-content-server instance",
doc: "The url of the correspoding fxa-content-server instance",
default: 'http://127.0.0.1:3030',
env: 'CONTENT_SERVER_URL'
}
},
scryptHelper: {
url: {
doc: "The url of the correspoding fxa-scrypt-helper instance",
default: 'https://scrypt-accounts.dev.lcip.org',
env: 'SCRYPT_HELPER_URL'
}
},
smtp: {
api: {
host: {

0 comments on commit 1337b50

Please sign in to comment.