Refactor config.cloudUrl to config.keyServerUrl

This commit is contained in:
Tankred Hase 2015-02-16 23:16:18 +01:00
parent 93dc53f7b7
commit 91693c62ad
7 changed files with 13 additions and 13 deletions

View File

@ -12,7 +12,7 @@ module.exports = appCfg;
* Global app configurations
*/
appCfg.config = {
cloudUrl: 'https://keys.whiteout.io',
keyServerUrl: 'https://keys.whiteout.io',
hkpUrl: 'http://keyserver.ubuntu.com',
privkeyServerUrl: 'https://keychain.whiteout.io',
adminUrl: 'https://admin-node.whiteout.io',
@ -68,7 +68,7 @@ function setConfigParams(manifest) {
}
// get key server base url
cfg.cloudUrl = getUrl('https://keys');
cfg.keyServerUrl = getUrl('https://keys');
// get keychain server base url
cfg.privkeyServerUrl = getUrl('https://keychain');
// get the app version

View File

@ -27,7 +27,7 @@ var AccountCtrl = function($scope, $q, auth, keychain, pgp, appConfig, download,
var fpr = keyParams.fingerprint;
$scope.fingerprint = fpr.slice(0, 4) + ' ' + fpr.slice(4, 8) + ' ' + fpr.slice(8, 12) + ' ' + fpr.slice(12, 16) + ' ' + fpr.slice(16, 20) + ' ' + fpr.slice(20, 24) + ' ' + fpr.slice(24, 28) + ' ' + fpr.slice(28, 32) + ' ' + fpr.slice(32, 36) + ' ' + fpr.slice(36);
$scope.keysize = keyParams.bitSize;
$scope.publicKeyUrl = appConfig.config.cloudUrl + '/' + userId;
$scope.publicKeyUrl = appConfig.config.keyServerUrl + '/' + userId;
//
// scope functions

View File

@ -18,7 +18,7 @@ var ContactsCtrl = function($scope, $q, keychain, pgp, dialog, appConfig) {
}
};
$scope.whiteoutKeyServer = appConfig.config.cloudUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
$scope.whiteoutKeyServer = appConfig.config.keyServerUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
//
// scope functions

View File

@ -347,7 +347,7 @@ Email.prototype.fetchMessages = function(options) {
bodyParts: message.bodyParts
}).then(function(parsedBodyParts) {
var body = _.pluck(filterBodyParts(parsedBodyParts, MSG_PART_TYPE_TEXT), MSG_PART_ATTR_CONTENT).join('\n'),
verificationUrlPrefix = config.cloudUrl + config.verificationUrl,
verificationUrlPrefix = config.keyServerUrl + config.verificationUrl,
uuid = body.split(verificationUrlPrefix).pop().substr(0, config.verificationUuidLength),
uuidRegex = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/;
@ -927,7 +927,7 @@ Email.prototype.sendEncrypted = function(options, mailer) {
*/
Email.prototype.sendPlaintext = function(options, mailer) {
// add suffix to plaintext mail
options.email.body += str.signature + config.cloudUrl + '/' + this._account.emailAddress;
options.email.body += str.signature + config.keyServerUrl + '/' + this._account.emailAddress;
// mime encode, sign and send email via smtp
return this._sendGeneric({
smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage

View File

@ -5,7 +5,7 @@ var ngModule = angular.module('woServices');
// rest dao for use in the public key service
ngModule.factory('publicKeyRestDao', function(appConfig) {
var dao = new RestDAO();
dao.setBaseUri(appConfig.config.cloudUrl);
dao.setBaseUri(appConfig.config.keyServerUrl);
return dao;
});
@ -19,7 +19,7 @@ ngModule.factory('privateKeyRestDao', function(appConfig) {
// rest dao for use in the invitation service
ngModule.factory('invitationRestDao', function(appConfig) {
var dao = new RestDAO();
dao.setBaseUri(appConfig.config.cloudUrl);
dao.setBaseUri(appConfig.config.keyServerUrl);
return dao;
});
@ -133,7 +133,7 @@ RestDAO.prototype._processRequest = function(options) {
if (options.type === 'json') {
try {
res = JSON.parse(xhr.responseText);
} catch(e) {
} catch (e) {
res = xhr.responseText;
}
} else {

View File

@ -751,7 +751,7 @@ describe('Email DAO integration tests', function() {
expect(message.signed).to.be.true;
expect(message.signaturesValid).to.be.true;
expect(message.attachments.length).to.equal(0);
expect(message.body).to.equal(expectedBody + str.signature + config.cloudUrl + '/' + testAccount.user);
expect(message.body).to.equal(expectedBody + str.signature + config.keyServerUrl + '/' + testAccount.user);
done();
});
};

View File

@ -467,7 +467,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts
}).returns(resolves([{
type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
}]));
keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves());
@ -500,7 +500,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts
}).returns(resolves([{
type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + corruptedUuid
content: '' + cfg.keyServerUrl + cfg.verificationUrl + corruptedUuid
}]));
localStoreStub.withArgs({
@ -531,7 +531,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts
}).returns(resolves([{
type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
}]));
keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({}));