From 5f02c4b5ad84bb8a53e9f174c9ac81b66ff8db0e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 18 Nov 2019 15:17:06 +0000 Subject: [PATCH] Namespace default secret storage key methods --- spec/unit/crypto/secrets.spec.js | 2 +- src/client.js | 8 ++++---- src/crypto/index.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/unit/crypto/secrets.spec.js b/spec/unit/crypto/secrets.spec.js index 0fa1aa56e..03866b6a9 100644 --- a/spec/unit/crypto/secrets.spec.js +++ b/spec/unit/crypto/secrets.spec.js @@ -168,7 +168,7 @@ describe("Secrets", function() { ); // we don't await on this because it waits for the event to come down the sync // which won't happen in the test setup - alice.setDefaultKeyId(newKeyId); + alice.setDefaultSecretStorageKeyId(newKeyId); await alice.storeSecret("foo", "bar"); const accountData = alice.getAccountData('foo'); diff --git a/src/client.js b/src/client.js index d5c56838a..187944420 100644 --- a/src/client.js +++ b/src/client.js @@ -1115,7 +1115,7 @@ MatrixClient.prototype.checkEventSenderTrust = async function(event) { * Get the current default key ID for encrypting secrets. * The Secure Secret Storage API is currently UNSTABLE and may change without notice. * - * @function module:client~MatrixClient#getDefaultKeyId + * @function module:client~MatrixClient#getDefaultSecretStorageKeyId * * @return {string} The default key ID or null if no default key ID is set */ @@ -1124,7 +1124,7 @@ MatrixClient.prototype.checkEventSenderTrust = async function(event) { * Set the current default key ID for encrypting secrets. * The Secure Secret Storage API is currently UNSTABLE and may change without notice. * - * @function module:client~MatrixClient#setDefaultKeyId + * @function module:client~MatrixClient#setDefaultSecretStorageKeyId * @param {string} keyId The new default key ID */ @@ -1134,8 +1134,8 @@ wrapCryptoFuncs(MatrixClient, [ "getSecret", "isSecretStored", "requestSecret", - "getDefaultKeyId", - "setDefaultKeyId", + "getDefaultSecretStorageKeyId", + "setDefaultSecretStorageKeyId", ]); /** diff --git a/src/crypto/index.js b/src/crypto/index.js index 32499e26a..b1ace2b48 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -299,11 +299,11 @@ Crypto.prototype.requestSecret = function(name, devices) { return this._secretStorage.request(name, devices); }; -Crypto.prototype.getDefaultKeyId = function() { +Crypto.prototype.getDefaultSecretStorageKeyId = function() { return this._secretStorage.getDefaultKeyId(); }; -Crypto.prototype.setDefaultKeyId = function(k) { +Crypto.prototype.setDefaultSecretStorageKeyId = function(k) { return this._secretStorage.setDefaultKeyId(k); };