<commit_before>require 'omniauth/strategies/oauth2'

module OmniAuth
  module Strategies
    class Noosfero < OmniAuth::Strategies::OAuth2

      DefaultScope = "userinfo.email,userinfo.identifier,userinfo.name"

      # just a reference name, the name varies with the identifier (see below)
      option :name, 'noosfero'

      option :client_options, {
        :site          => nil, # set dinamically
        :authorize_url => "#{OauthPlugin.path_prefix}/provider/authorize",
        :token_url     => "#{OauthPlugin.path_prefix}/provider/token",
        :userinfo_url  => "#{OauthPlugin.path_prefix}/api/userinfo",
      }
      option :provider_ignores_state, true

      uid do
        raw_info['userinfo']['email']
      end
      info do
        {
          :email => raw_info['userinfo']['email'],
          :identifier => raw_info['userinfo']['identifier'],
          :name => raw_info['userinfo']['name'],
        }
      end

      def callback_path
        "#{path_prefix}/callback/#{name}"
      end

      def name
        return options.name unless request.path.starts_with? OauthPlugin::path_prefix
        provider.identifier rescue options.name
      end

      def domain
        @domain ||= Domain.find_by_name request.host
      end

      def environment
        @environment ||= domain.environment rescue Environment.default
      end
<commit_msg>oauth: Remove scope<commit_after>require 'omniauth/strategies/oauth2'

module OmniAuth
  module Strategies
    class Noosfero < OmniAuth::Strategies::OAuth2

      DefaultScope = "userinfo.email,userinfo.identifier,userinfo.name"

      # just a reference name, the name varies with the identifier (see below)
      option :name, 'noosfero'

      option :client_options, {
        :site          => nil, # set dinamically
        :authorize_url => "#{OauthPlugin.path_prefix}/provider/authorize",
        :token_url     => "#{OauthPlugin.path_prefix}/provider/token",
        :userinfo_url  => "#{OauthPlugin.path_prefix}/api/userinfo",
      }
      option :provider_ignores_state, true

      uid do
        raw_info['userinfo']['email']
      end
      info do
        {
          :email => raw_info['userinfo']['email'],
          :identifier => raw_info['userinfo']['identifier'],
          :name => raw_info['userinfo']['name'],
        }
      end

      def callback_path
        "#{path_prefix}/callback/#{name}"
      end

      def name
        return options.name unless request.path.starts_with? ::OauthPlugin::path_prefix
        provider.identifier rescue options.name
      end

      def domain
        @domain ||= Domain.find_by_name request.host
      end

      def environment
        @environment ||= domain.environment rescue Environment.default
      end

{'fraction_non_alphanumeric': 0.11082848837209303, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 2.543114543114543, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '7653800', 'n_tokens_mistral': 798, 'n_tokens_neox': 779, 'n_words': 166}