<commit_before>require 'openid/store/filesystem'

Rails.application.config.middleware.use OmniAuth::Builder do
  SETTINGS['auth_credentials'].each do |provider_name, opts|
    provider  provider_name.to_sym, opts['key'], opts['secret']
  end

  provider :open_id, OpenID::Store::Filesystem.new('/tmp')
end


consumers = {}
SETTINGS['auth_credentials'].each do |provider_name, opts|
  strategy_class = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(provider_name)}")
  strategy = strategy_class.new(nil, opts['key'], opts['secret'])

  if strategy.is_a?(OmniAuth::Strategies::OAuth)
    consumers[provider_name] = strategy.consumer
  elsif strategy.is_a?(OmniAuth::Strategies::OAuth2)
    consumers[provider_name] = strategy.client
  end
end

OAUTH_CONSUMERS = consumers
<commit_msg>Add support for the google_apps omniauth provider.<commit_after>require 'openid/store/filesystem'

Rails.application.config.middleware.use OmniAuth::Builder do
  SETTINGS['auth_credentials'].each do |provider_name, opts|
    provider  provider_name.to_sym, opts['key'], opts['secret']
  end

  provider :open_id, OpenID::Store::Filesystem.new('/tmp')
  provider :google_apps, OpenID::Store::Filesystem.new('/tmp')
end


consumers = {}
SETTINGS['auth_credentials'].each do |provider_name, opts|
  strategy_class = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(provider_name)}")
  strategy = strategy_class.new(nil, opts['key'], opts['secret'])

  if strategy.is_a?(OmniAuth::Strategies::OAuth)
    consumers[provider_name] = strategy.consumer
  elsif strategy.is_a?(OmniAuth::Strategies::OAuth2)
    consumers[provider_name] = strategy.client
  end
end

OAUTH_CONSUMERS = consumers

{'fraction_non_alphanumeric': 0.13803317535545023, 'fraction_numerical': 0.001184834123222749, 'mean_word_length': 6.783410138248848, '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': '4016602', 'n_tokens_mistral': 565, 'n_tokens_neox': 568, 'n_words': 91}