Simplest possible patch to make scrypt-helper URL configurable.

This commit is contained in:
Ryan Kelly 2013-12-17 16:43:00 +11:00
Родитель d7e32c2d7b
Коммит 57448828f7
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -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: {