Sha256: 3855b8b33f6eb473615401ed812776e03691c6959f7a6e4a3b0937c77886eff9

Contents?: true

Size: 909 Bytes

Versions: 31

Compression:

Stored size: 909 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, :ts, :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]
              @ts = auth_params[:ts]
              @ext = auth_params[:ext]
              @signature = auth_params[:mac]
              self
            end

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rack-oauth2-1.21.3 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.21.2 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.21.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.21.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.20.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.19.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.18.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.17.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.16.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.15.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.14.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.13.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.13.0.beta lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.12.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.11.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.10.1 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.10.0 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.9.3 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.9.2 lib/rack/oauth2/server/resource/mac.rb
rack-oauth2-1.9.1 lib/rack/oauth2/server/resource/mac.rb