Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 91693c6

Browse files
author
Tankred Hase
committed
Refactor config.cloudUrl to config.keyServerUrl
1 parent 93dc53f commit 91693c6

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/js/app-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = appCfg;
1212
* Global app configurations
1313
*/
1414
appCfg.config = {
15-
cloudUrl: 'https://keys.whiteout.io',
15+
keyServerUrl: 'https://keys.whiteout.io',
1616
hkpUrl: 'http://keyserver.ubuntu.com',
1717
privkeyServerUrl: 'https://keychain.whiteout.io',
1818
adminUrl: 'https://admin-node.whiteout.io',
@@ -68,7 +68,7 @@ function setConfigParams(manifest) {
6868
}
6969

7070
// get key server base url
71-
cfg.cloudUrl = getUrl('https://keys');
71+
cfg.keyServerUrl = getUrl('https://keys');
7272
// get keychain server base url
7373
cfg.privkeyServerUrl = getUrl('https://keychain');
7474
// get the app version

src/js/controller/app/account.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var AccountCtrl = function($scope, $q, auth, keychain, pgp, appConfig, download,
2727
var fpr = keyParams.fingerprint;
2828
$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);
2929
$scope.keysize = keyParams.bitSize;
30-
$scope.publicKeyUrl = appConfig.config.cloudUrl + '/' + userId;
30+
$scope.publicKeyUrl = appConfig.config.keyServerUrl + '/' + userId;
3131

3232
//
3333
// scope functions

src/js/controller/app/contacts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var ContactsCtrl = function($scope, $q, keychain, pgp, dialog, appConfig) {
1818
}
1919
};
2020

21-
$scope.whiteoutKeyServer = appConfig.config.cloudUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
21+
$scope.whiteoutKeyServer = appConfig.config.keyServerUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
2222

2323
//
2424
// scope functions

src/js/email/email.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Email.prototype.fetchMessages = function(options) {
347347
bodyParts: message.bodyParts
348348
}).then(function(parsedBodyParts) {
349349
var body = _.pluck(filterBodyParts(parsedBodyParts, MSG_PART_TYPE_TEXT), MSG_PART_ATTR_CONTENT).join('\n'),
350-
verificationUrlPrefix = config.cloudUrl + config.verificationUrl,
350+
verificationUrlPrefix = config.keyServerUrl + config.verificationUrl,
351351
uuid = body.split(verificationUrlPrefix).pop().substr(0, config.verificationUuidLength),
352352
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}/;
353353

@@ -927,7 +927,7 @@ Email.prototype.sendEncrypted = function(options, mailer) {
927927
*/
928928
Email.prototype.sendPlaintext = function(options, mailer) {
929929
// add suffix to plaintext mail
930-
options.email.body += str.signature + config.cloudUrl + '/' + this._account.emailAddress;
930+
options.email.body += str.signature + config.keyServerUrl + '/' + this._account.emailAddress;
931931
// mime encode, sign and send email via smtp
932932
return this._sendGeneric({
933933
smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage

src/js/service/rest.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var ngModule = angular.module('woServices');
55
// rest dao for use in the public key service
66
ngModule.factory('publicKeyRestDao', function(appConfig) {
77
var dao = new RestDAO();
8-
dao.setBaseUri(appConfig.config.cloudUrl);
8+
dao.setBaseUri(appConfig.config.keyServerUrl);
99
return dao;
1010
});
1111

@@ -19,7 +19,7 @@ ngModule.factory('privateKeyRestDao', function(appConfig) {
1919
// rest dao for use in the invitation service
2020
ngModule.factory('invitationRestDao', function(appConfig) {
2121
var dao = new RestDAO();
22-
dao.setBaseUri(appConfig.config.cloudUrl);
22+
dao.setBaseUri(appConfig.config.keyServerUrl);
2323
return dao;
2424
});
2525

@@ -133,7 +133,7 @@ RestDAO.prototype._processRequest = function(options) {
133133
if (options.type === 'json') {
134134
try {
135135
res = JSON.parse(xhr.responseText);
136-
} catch(e) {
136+
} catch (e) {
137137
res = xhr.responseText;
138138
}
139139
} else {

test/integration/email-dao-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ describe('Email DAO integration tests', function() {
751751
expect(message.signed).to.be.true;
752752
expect(message.signaturesValid).to.be.true;
753753
expect(message.attachments.length).to.equal(0);
754-
expect(message.body).to.equal(expectedBody + str.signature + config.cloudUrl + '/' + testAccount.user);
754+
expect(message.body).to.equal(expectedBody + str.signature + config.keyServerUrl + '/' + testAccount.user);
755755
done();
756756
});
757757
};

test/unit/email/email-dao-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ describe('Email DAO unit tests', function() {
467467
bodyParts: message.bodyParts
468468
}).returns(resolves([{
469469
type: 'text',
470-
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
470+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
471471
}]));
472472

473473
keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves());
@@ -500,7 +500,7 @@ describe('Email DAO unit tests', function() {
500500
bodyParts: message.bodyParts
501501
}).returns(resolves([{
502502
type: 'text',
503-
content: '' + cfg.cloudUrl + cfg.verificationUrl + corruptedUuid
503+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + corruptedUuid
504504
}]));
505505

506506
localStoreStub.withArgs({
@@ -531,7 +531,7 @@ describe('Email DAO unit tests', function() {
531531
bodyParts: message.bodyParts
532532
}).returns(resolves([{
533533
type: 'text',
534-
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
534+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
535535
}]));
536536

537537
keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({}));

0 commit comments

Comments
 (0)