X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fbase.js;h=8331fb2336973a82c9223d5d3afadf00dfd62710;hb=3ca7fccb306d0b23626befc3791ffa360b3db1e7;hp=2be2db0dea69d106f064c45e4639df95b72f6b74;hpb=1c37a7c533a5530390489ea9a49dcca492db1074;p=websub-hub diff --git a/src/db/base.js b/src/db/base.js index 2be2db0..8331fb2 100644 --- a/src/db/base.js +++ b/src/db/base.js @@ -12,9 +12,8 @@ const svh = require('./schema-version-helper'); const _fileScope = common.fileScope(__filename); class Database { - constructor(logger = common.nullLogger, options = {}) { + constructor(logger, options = {}) { this.logger = logger; - common.ensureLoggerLevels(this.logger); // Store the merged config and default values for lease values. // N.B. breaking hierarchy of config options here @@ -327,12 +326,35 @@ class Database { * @param {*} dbCtx db context * @param {string} identifier authentication identifier * @param {string} credential authentication credential + * @param {string=} otpKey authentication otp key */ - async authenticationUpsert(dbCtx, identifier, credential) { + async authenticationUpsert(dbCtx, identifier, credential, otpKey) { this._notImplemented('authenticationUpsert', arguments); } + /** + * Update an authentication entity's otp key. + * @param {*} dbCtx db context + * @param {string} identifier authentication identifier + * @param {string=} otpKey authentication otp key + */ + async authenticationUpdateOTPKey(dbCtx, identifier, otpKey) { + this._notImplemented('authenticationUpdateKey', arguments); + } + + + /** + * Update an authentication entity's credential. + * @param {*} dbCtx db context + * @param {string} identifier authentication identifier + * @param {string} credential authentication credential + */ + async authenticationUpdateCredential(dbCtx, identifier, credential) { + this._notImplemented('authenticationUpdateKey', arguments); + } + + /** * All subscriptions to a topic. * @param {*} dbCtx db context