mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
[CHORE] vault client: get 2fa HMAC instead of ECDSA
This commit is contained in:
@@ -527,17 +527,17 @@ BlobObj.prototype.postUpdate = function(op, pointer, params, fn) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get2FA - ECDSA signed request
|
* get2FA - HMAC signed request
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BlobObj.prototype.get2FA = function (masterkey, fn) {
|
BlobObj.prototype.get2FA = function (fn) {
|
||||||
var config = {
|
var config = {
|
||||||
method : 'GET',
|
method : 'GET',
|
||||||
url : this.url + '/v1/blob/' + this.id + '/2FA?device_id=' + this.device_id,
|
url : this.url + '/v1/blob/' + this.id + '/2FA?device_id=' + this.device_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
var signedRequest = new SignedRequest(config);
|
var signedRequest = new SignedRequest(config);
|
||||||
var signed = signedRequest.signAsymmetric(masterkey, this.data.account_id, this.id);
|
var signed = signedRequest.signHmac(this.data.auth_secret, this.id);
|
||||||
|
|
||||||
request.get(signed.url)
|
request.get(signed.url)
|
||||||
.end(function(err, resp) {
|
.end(function(err, resp) {
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ describe('Blob', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('#2FA_get2FA', function (done) {
|
it('#2FA_get2FA', function (done) {
|
||||||
blob.get2FA(exampleData.masterkey, function(err, resp) {
|
blob.get2FA(function(err, resp) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(typeof resp, 'object');
|
assert.strictEqual(typeof resp, 'object');
|
||||||
assert.strictEqual(typeof resp.result, 'string');
|
assert.strictEqual(typeof resp.result, 'string');
|
||||||
|
|||||||
Reference in New Issue
Block a user