<commit_before>const HttpUtil = require('./http.js');

class Auth {
  constructor(httpRequest) {
    this.httpRequest = httpRequest;
  }

  basic(user, pass) {
    let authHeader = Auth.toBase64(`${user}:${pass}`);
    return `Basic ${authHeader}`;
  }

  addAuth(user, pass, bearer) {
    if (user && pass) {
      this.httpRequest.setHeader(HttpUtil.Headers.AUTHORIZATION, this.basic(user, pass));
    }
  }

  static toBase64(str) {
    return Buffer.from(str).toString('base64');
  }
}

module.exports = Auth;<commit_msg>chore: removed unused function variable from authorization (#2342)<commit_after>const HttpUtil = require('./http.js');

class Auth {
  constructor(httpRequest) {
    this.httpRequest = httpRequest;
  }

  basic(user, pass) {
    return `Basic ${Auth.toBase64(`${user}:${pass}`)}`;
  }

  addAuth(user, pass) {
    if (user && pass) {
      this.httpRequest.setHeader(HttpUtil.Headers.AUTHORIZATION, this.basic(user, pass));
    }
  }

  static toBase64(str) {
    return Buffer.from(str).toString('base64');
  }
}

module.exports = Auth;
{'fraction_non_alphanumeric': 0.16290018832391714, 'fraction_numerical': 0.015065913370998116, 'mean_word_length': 3.8099547511312215, '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': '1727018', 'n_tokens_mistral': 374, 'n_tokens_neox': 358, 'n_words': 64}