mastercard_oauth1_signer 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e52e7a13c81a01dea40d2fa0319d56621a4c1d5966bc96b386b1b09c766cfbb
4
- data.tar.gz: f5073154eda820ace6641ca7362b3e1db91a62c0bb478751c4850ecc3f179c65
3
+ metadata.gz: e66edf3b0c03d25a2eeec6d3b3672539c9fb7c83d1c53027b503beb188011ce5
4
+ data.tar.gz: 30c885f68af13a3664ef2ca24e3f68106f9d44787a99c61b815a9012d305b91f
5
5
  SHA512:
6
- metadata.gz: b5c077259309f75298276fd57538de40126b20be38514e1de00ce34e8c86e8b833133b17c7c08c1edb96f174f68d3431c8fc3079b73570d7ad4a7525664f8be5
7
- data.tar.gz: ffbdb6961f7b8b08e7a639c3e57cac9d64c9732498298e94350e7bd2417c5c143b30a4205a6467dd10528b61a9411ac69bb43e1215acbdf61a9fb454460750b3
6
+ metadata.gz: dfafbf1ba178b3dfcb1b34036b2ae4f76fac07d7ab6bf99e45e4c6dfa983ed0374ed8678e9d95f64a2c864758b85347052ec6f3f351ca8a561f19277aa217769
7
+ data.tar.gz: 33be101c0648a58d6d99cb03e9e9095da355f0542aab98ce9be29311c4a20858e62fd1ab143e8c53e4fbcc1de7b3e757b3178302dd408de64f928398a69ee58a
@@ -75,9 +75,7 @@ class OAuth
75
75
  def get_oauth_params(consumer_key, payload = nil)
76
76
  oauth_params = {}
77
77
 
78
- unless payload.nil?
79
- oauth_params['oauth_body_hash'] = get_body_hash(payload)
80
- end
78
+ oauth_params['oauth_body_hash'] = get_body_hash(payload)
81
79
  oauth_params['oauth_consumer_key'] = consumer_key
82
80
  oauth_params['oauth_nonce'] = get_nonce
83
81
  oauth_params['oauth_signature_method'] = "RSA-SHA#{SHA_BITS}"
@@ -114,8 +112,11 @@ class OAuth
114
112
  def get_base_uri_string(uri)
115
113
  url = URI.parse(uri)
116
114
  # Lowercase scheme and authority
117
- # Remove query and fragment
118
- "#{url.scheme.downcase}://#{url.host.downcase}#{url.path}"
115
+ # Remove redundant port, query, and fragment
116
+ base_uri = "#{url.scheme.downcase}://#{url.host.downcase}"
117
+ base_uri += ":#{url.port}" if url.scheme.downcase == "https" and url.port != 443
118
+ base_uri += ":#{url.port}" if url.scheme.downcase == "http" and url.port != 80
119
+ base_uri += "/#{url.path[1..-1]}"
119
120
  end
120
121
 
121
122
  #
@@ -126,7 +127,6 @@ class OAuth
126
127
  # @param {Map<String, String>} oauthParamsMap Map of OAuth parameters to be included in Authorization header
127
128
  # @return {String} Correctly encoded and sorted OAuth parameter string
128
129
  #
129
-
130
130
  def to_oauth_param_string(query_params_map, oauth_param_map)
131
131
  consolidated_params = {}.merge(query_params_map)
132
132
 
@@ -1,15 +1,18 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "mastercard_oauth1_signer"
3
3
  gem.authors = ["Mastercard"]
4
- gem.summary = %q{OAuth signature SDK}
4
+ gem.summary = %q{Mastercard client authentication library}
5
5
  gem.description = %q{Zero dependency library for generating a Mastercard API compliant OAuth signature}
6
- gem.version = "1.1.0"
6
+ gem.version = "1.1.1"
7
7
  gem.license = "MIT"
8
8
  gem.homepage = "https://github.com/Mastercard/oauth1-signer-ruby"
9
9
  gem.files = Dir["{bin,spec,lib}/**/*"]+ Dir["data/*"] + ["oauth1_signer_ruby.gemspec"]
10
10
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.require_paths = ["lib"]
13
- gem.add_development_dependency "bundler", "~> 1.5"
14
- gem.add_development_dependency "rake", "~> 0"
13
+
14
+ gem.add_development_dependency 'bundler', '>= 1.5'
15
+ gem.add_development_dependency 'minitest', '~> 5.0'
16
+ gem.add_development_dependency 'rake', ">= 12.3.3"
17
+ gem.add_development_dependency 'simplecov', '~> 0.16.1'
15
18
  end
metadata CHANGED
@@ -1,43 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastercard_oauth1_signer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mastercard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-03 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 12.3.3
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 12.3.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: '0'
61
+ version: 0.16.1
34
62
  type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '0'
68
+ version: 0.16.1
41
69
  description: Zero dependency library for generating a Mastercard API compliant OAuth
42
70
  signature
43
71
  email:
@@ -70,5 +98,5 @@ rubyforge_project:
70
98
  rubygems_version: 2.7.7
71
99
  signing_key:
72
100
  specification_version: 4
73
- summary: OAuth signature SDK
101
+ summary: Mastercard client authentication library
74
102
  test_files: []