<commit_before>function (user, context, callback) {
  if (!user) {
    // If the user is not presented (i.e. a rule deleted it), just go on, since authenticate will always fail.
    return callback(null, null, context);
  }

  var ALLOWED_CLIENTIDS = [
    'x7TF6ZtJev4ktoHR4ObWmA9KeqGni6rq', //Braintree (Sandbox)
    'ozUjpwx3febe1RG7ib30FLggNkE4coZY', //Braintree
  ];

  if (ALLOWED_CLIENTIDS.indexOf(context.clientID) >= 0) {

      user.grant_all_merchant_accounts = "true";

      context.samlConfiguration.mappings = {
        "grant_all_merchant_accounts":       "grant_all_merchant_accounts",
      };

    callback(null, user, context);
  } else {
      callback(null, user, context);
  }
}<commit_msg>adding extra roles attribute per requirement<commit_after>function (user, context, callback) {
  if (!user) {
    // If the user is not presented (i.e. a rule deleted it), just go on, since authenticate will always fail.
    return callback(null, null, context);
  }

  var ALLOWED_CLIENTIDS = [
    'x7TF6ZtJev4ktoHR4ObWmA9KeqGni6rq', //Braintree (Sandbox)
    'ozUjpwx3febe1RG7ib30FLggNkE4coZY', //Braintree
  ];

  if (ALLOWED_CLIENTIDS.indexOf(context.clientID) >= 0) {

      user.grant_all_merchant_accounts = "true";

      context.samlConfiguration.mappings = {
        "grant_all_merchant_accounts":       "grant_all_merchant_accounts",
        "roles":        "app_metadata.groups",
      };

    callback(null, user, context);
  } else {
      callback(null, user, context);
  }
}
{'fraction_non_alphanumeric': 0.11502659574468085, 'fraction_numerical': 0.017287234042553192, 'mean_word_length': 3.426470588235294, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 5, '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': '7370734', 'n_tokens_mistral': 558, 'n_tokens_neox': 534, 'n_words': 109}