<commit_before>module Rack
  module OAuth2
    module Server
      class Token
        module Extension
          class JWT < Abstract::Handler
            GRANT_TYPE_URN = 'urn:ietf:params:oauth:grant-type:jwt-bearer'

            class << self
              def grant_type_for?(grant_type)
                grant_type == GRANT_TYPE_URN
              end
            end

            def call(env)
              @request  = Request.new env
              @response = Response.new request
              super
            end

            class Request < Authorize::Token::Request
              attr_required :assertion

              def initialize(env)
                super
                @grant_type = GRANT_TYPE_URN
                @assertion = params['assertion']
                attr_missing!
              end
            end
          end
        end
      end
    end
  end
end<commit_msg>wrong class hierarchy client_id is optional when using assertion<commit_after>module Rack
  module OAuth2
    module Server
      class Token
        module Extension
          class JWT < Abstract::Handler
            GRANT_TYPE_URN = 'urn:ietf:params:oauth:grant-type:jwt-bearer'

            class << self
              def grant_type_for?(grant_type)
                grant_type == GRANT_TYPE_URN
              end
            end

            def call(env)
              @request  = Request.new env
              @response = Response.new request
              super
            end

            class Request < Token::Request
              attr_required :assertion

              # NOTE: client_id is required as default, but optional when using assertion.
              @required_attributes.delete :client_id

              def initialize(env)
                super
                @grant_type = GRANT_TYPE_URN
                @assertion = params['assertion']
                attr_missing!
              end
            end
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.05103587670540677, 'fraction_numerical': 0.001010611419909045, 'mean_word_length': 1.2811059907834101, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7141177', 'n_tokens_mistral': 509, 'n_tokens_neox': 472, 'n_words': 128}