This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs-blog-newsletter/cronjob/node_modules/mongodb/lib/cmap/auth/auth_provider.js

39 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2024-05-26 22:54:55 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthProvider = exports.AuthContext = void 0;
const error_1 = require("../../error");
/**
* Context used during authentication
* @internal
*/
class AuthContext {
constructor(connection, credentials, options) {
this.connection = connection;
this.credentials = credentials;
this.options = options;
}
}
exports.AuthContext = AuthContext;
class AuthProvider {
/**
* Prepare the handshake document before the initial handshake.
*
* @param handshakeDoc - The document used for the initial handshake on a connection
* @param authContext - Context for authentication flow
*/
prepare(handshakeDoc, authContext, callback) {
callback(undefined, handshakeDoc);
}
/**
* Authenticate
*
* @param context - A shared context for authentication flow
* @param callback - The callback to return the result from the authentication
*/
auth(context, callback) {
// TODO(NODE-3483): Replace this with MongoMethodOverrideError
callback(new error_1.MongoRuntimeError('`auth` method must be overridden by subclass'));
}
}
exports.AuthProvider = AuthProvider;
//# sourceMappingURL=auth_provider.js.map