defaultAuthProviders.js 770 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const MongoCR = require('./mongocr');
  3. const X509 = require('./x509');
  4. const Plain = require('./plain');
  5. const GSSAPI = require('./gssapi');
  6. const SSPI = require('./sspi');
  7. const ScramSHA1 = require('./scram').ScramSHA1;
  8. const ScramSHA256 = require('./scram').ScramSHA256;
  9. /**
  10. * Returns the default authentication providers.
  11. *
  12. * @param {BSON} bson Bson definition
  13. * @returns {Object} a mapping of auth names to auth types
  14. */
  15. function defaultAuthProviders(bson) {
  16. return {
  17. mongocr: new MongoCR(bson),
  18. x509: new X509(bson),
  19. plain: new Plain(bson),
  20. gssapi: new GSSAPI(bson),
  21. sspi: new SSPI(bson),
  22. 'scram-sha-1': new ScramSHA1(bson),
  23. 'scram-sha-256': new ScramSHA256(bson)
  24. };
  25. }
  26. module.exports = { defaultAuthProviders };