diff --git a/Gruntfile.js b/Gruntfile.js index 98dd472..acbd04f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -295,7 +295,8 @@ module.exports = function(grunt) { suffix: ' (Beta)', version: version, deleteKey: true, - keyServer: 'https://keys.whiteout.io/' + keyServer: 'https://keys.whiteout.io/', + keychainServer: 'https://keychain.whiteout.io/' }); }); @@ -317,6 +318,10 @@ module.exports = function(grunt) { var ksIndex = manifest.permissions.indexOf('https://keys-test.whiteout.io/'); manifest.permissions[ksIndex] = options.keyServer; } + if (options.keychainServer) { + var kcsIndex = manifest.permissions.indexOf('https://keychain-test.whiteout.io/'); + manifest.permissions[kcsIndex] = options.keychainServer; + } if (options.deleteKey) { delete manifest.key; } diff --git a/src/js/app-config.js b/src/js/app-config.js index b841d80..b0b7ac9 100644 --- a/src/js/app-config.js +++ b/src/js/app-config.js @@ -3,7 +3,7 @@ define(function(require) { var _ = require('underscore'), app = {}, - appVersion, cloudUrl, clientId; + appVersion, cloudUrl, keychainUrl, clientId; // parse manifest to get configurations for current runtime try { @@ -14,6 +14,12 @@ define(function(require) { }); // remove last '/' from url due to required syntax in manifest cloudUrl = cloudUrl.substring(0, cloudUrl.length - 1); + // get keychain server base url + keychainUrl = _.find(manifest.permissions, function(permission) { + return typeof permission === 'string' && permission.indexOf('https://keychain') === 0; + }); + // remove last '/' from url due to required syntax in manifest + keychainUrl = keychainUrl.substring(0, keychainUrl.length - 1); // get client ID for OAuth requests clientId = manifest.oauth2.client_id; // get the app version @@ -25,7 +31,7 @@ define(function(require) { */ app.config = { cloudUrl: cloudUrl || 'https://keys.whiteout.io', - privkeyServerUrl: 'https://keychain-test.whiteout.io', + privkeyServerUrl: keychainUrl || 'https://keychain.whiteout.io', serverPrivateKeyId: 'EE342F0DDBB0F3BE', symKeySize: 256, symIvSize: 96, diff --git a/src/manifest.json b/src/manifest.json index bd841e9..258a7c1 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -13,6 +13,7 @@ }, "notifications", "https://keys-test.whiteout.io/", + "https://keychain-test.whiteout.io/", "https://www.googleapis.com/", "identity", { "socket": [