update dependencies, fixes to support new authentication features
[websub-hub] / src / db / base.js
index 2be2db0dea69d106f064c45e4639df95b72f6b74..8331fb2336973a82c9223d5d3afadf00dfd62710 100644 (file)
@@ -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