Sha256: acdae8fc1582b8b37772aa437867e6de05a03cd0a9876d640ffa53586e8fd7b1

Contents?: true

Size: 847 Bytes

Versions: 17

Compression:

Stored size: 847 Bytes

Contents

require 'spec_helper'

describe Rack::OAuth2::AccessToken::MAC::Sha256HexVerifier do

  # From the example of webtopay wallet API spec
  # ref) https://www.webtopay.com/wallet/#authentication
  context 'when example from webtopay wallet API' do
    subject do
      Rack::OAuth2::AccessToken::MAC::Sha256HexVerifier.new(
        :algorithm => 'hmac-sha-256',
        :raw_body => 'grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA&redirect_uri=http%3A%2F%2Flocalhost%2Fabc'
      )
    end
    its(:calculate) { should == '21fb73c40b589622d0c78e9cd8900f89d9472aa724d0e5c3eca9ac1cd9d2a6d5' }
  end


  context 'when raw_body is empty' do
    subject do
      Rack::OAuth2::AccessToken::MAC::Sha256HexVerifier.new(
        :algorithm => 'hmac-sha-256',
        :raw_body => ''
      )
    end
    its(:calculate) { should be_nil }
  end

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rack-oauth2-1.1.1 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.1.0 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.10 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.9 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.8 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-revibe-1.0.7 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.7 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.6 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.5 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.4 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.3 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.2 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.1 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-1.0.0 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-0.14.9 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-0.14.8 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb
rack-oauth2-0.14.7 spec/rack/oauth2/access_token/mac/sha256_hex_verifier_spec.rb