Sha256: b316aeaf96d7580d7fd29d97ceb3e56c190ca78da913d91c14f3068c6ad31aa4

Contents?: true

Size: 755 Bytes

Versions: 59

Compression:

Stored size: 755 Bytes

Contents

module Rack
  module OAuth2
    class AccessToken
      class MAC
        class Signature < Verifier
          attr_required :secret, :ts, :nonce, :method, :request_uri, :host, :port
          attr_optional :ext, :query

          def calculate
            Rack::OAuth2::Util.base64_encode OpenSSL::HMAC.digest(
              hash_generator,
              secret,
              normalized_request_string
            )
          end

          def normalized_request_string
            [
              ts.to_i,
              nonce,
              method.to_s.upcase,
              request_uri,
              host,
              port,
              ext || '',
              nil
            ].join("\n")
          end

        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 2 rubygems

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