Sha256: 7c66caea66c887623cca7449c2f5e84f9b337d96164c4fcdea71ad981081c59f

Contents?: true

Size: 922 Bytes

Versions: 30

Compression:

Stored size: 922 Bytes

Contents

module Rack
  module OAuth2
    module Server
      class Resource
        class MAC < Resource
          def call(env)
            self.request = Request.new(env)
            super
          end

          private

          class Request < Resource::Request
            attr_reader :nonce, :body_hash, :ext, :signature

            def setup!
              auth_params = Rack::Auth::Digest::Params.parse(@auth_header.params).with_indifferent_access
              @access_token = auth_params[:id]
              @nonce = auth_params[:nonce]
              @body_hash = auth_params[:bodyhash]
              @ext = auth_params[:ext]
              @signature = auth_params[:mac]
              self
            end

            def oauth2?
              @auth_header.provided? && @auth_header.scheme == :mac
            end
          end
        end
      end
    end
  end
end

require 'rack/oauth2/server/resource/mac/error'

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rack-oauth2-0.14.4 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.14.3 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.14.2 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.14.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.14.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.13.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.12.2 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.12.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.12.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.11.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.10.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.10.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.10.0.alpha lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.5 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.4 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.3 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.2 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-0.9.0.alpha lib/rack/oauth2/server/resource/mac.rb