<commit_before>"use strict";

var BSON = require('bson');

var f = require('util').format
  , Binary = BSON.Binary
  , retrieveBSON = require('../connection/utils').retrieveBSON
  , Query = require('../connection/commands').Query
  , MongoError = require('../error');

var BSON = retrieveBSON();

var AuthSession = function(db, username, password) {
  this.db = db;
  this.username = username;
  this.password = password;
}

AuthSession.prototype.equal = function(session) {
  return session.db == this.db
    && session.username == this.username
    && session.password == this.password;
}

/**
 * Creates a new Plain authentication mechanism
 * @class
 * @return {Plain} A cursor instance
 */
var Plain = function(bson) {
  this.bson = bson;
  this.authStore = [];
}

/**<commit_msg>fix(auth): don't redeclare BSON variable in plain auth<commit_after>"use strict";

var BSON = require('bson');

var f = require('util').format
  , retrieveBSON = require('../connection/utils').retrieveBSON
  , Query = require('../connection/commands').Query
  , MongoError = require('../error');

var BSON = retrieveBSON()
  , Binary = BSON.Binary;

var AuthSession = function(db, username, password) {
  this.db = db;
  this.username = username;
  this.password = password;
}

AuthSession.prototype.equal = function(session) {
  return session.db == this.db
    && session.username == this.username
    && session.password == this.password;
}

/**
 * Creates a new Plain authentication mechanism
 * @class
 * @return {Plain} A cursor instance
 */
var Plain = function(bson) {
  this.bson = bson;
  this.authStore = [];
}

/**
{'fraction_non_alphanumeric': 0.15766604593420236, 'fraction_numerical': 0.0, 'mean_word_length': 3.8263473053892216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6768398', 'n_tokens_mistral': 509, 'n_tokens_neox': 498, 'n_words': 121}