oauth2 1.4.2 → 1.4.3

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: 6de8ef7ab0a480b7a6ce04291414f466818e21f3ca59927cec920f5587ad99a8
4
- data.tar.gz: 7d92dd6b75f2ce746dc73c406045e564ee0aa5aa6af6da7fd86e880b08a8fb2a
3
+ metadata.gz: d268c85a1429a82d674a4acab6c89cd9b3b64044c2629ce321f5a0aba9f0f1e9
4
+ data.tar.gz: 9aa05cb486902e77eadcb801cfc36febb48707cda62ae76899398876cbe312d9
5
5
  SHA512:
6
- metadata.gz: b456941102259c8318c986dd2715c52ecd49aa9413e7dee3c73c4580b2129b3302ed94741f1caf6707d54626702d4adbe033f952be16d2501cc2e9e2e57726a2
7
- data.tar.gz: f5a9b3c8802389bf18eb04ffeb368edd2a70ee11d2615d187296a99ed14ae1cf36bd88cc2f5bdd0512a0133a5ae174f29820492d678222eb6be71cc464bb501d
6
+ metadata.gz: f9684210662ed503a26ba29ee7f0049afcd1ff3c185fe008c0b78cf3a5822dc10f2010b7d38ac7bde7eea479e3f7e3828b329c8bbecf54c3da3d2280be00dcd7
7
+ data.tar.gz: 8e9e3503c15112cada5c355e28f1ab5068b302768e5ad2fad4204e574712bccf0387edda4d410fb3fb67c25d3850b1e1d032a342e0ace183871efded3115061d
@@ -1 +1 @@
1
- 2.6.3
1
+ 2.7.0
@@ -19,10 +19,23 @@ before_install:
19
19
  gem install --no-document bundler "bundler:>=2.0"
20
20
  fi
21
21
 
22
+ before_script:
23
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
24
+ - chmod +x ./cc-test-reporter
25
+ - ./cc-test-reporter before-build
26
+
27
+ after_script:
28
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
29
+
22
30
  bundler_args: --no-deployment --jobs 3 --retry 3
23
31
 
24
32
  cache: bundler
25
33
 
34
+ env:
35
+ global:
36
+ - JRUBY_OPTS="$JRUBY_OPTS -Xcli.debug=true --debug"
37
+ - CC_TEST_REPORTER_ID=29caf9cf27d27ae609c088feb9d4ba34460f7a39251f2e8615c9a16f3075530e
38
+
26
39
  language: ruby
27
40
 
28
41
  matrix:
@@ -31,6 +44,8 @@ matrix:
31
44
  - rvm: ruby-head
32
45
  - rvm: truffleruby
33
46
  - rvm: jruby-9.0
47
+ - rvm: jruby-9.1 # jruby-9.1 often fails to download, thus failing the build.
48
+ - rvm: jruby-9.2 # jruby-9.2 often fails to download, thus failing the build.
34
49
  fast_finish: true
35
50
  include:
36
51
  # - rvm: jruby-1.7 # targets MRI v1.9
@@ -60,6 +75,8 @@ matrix:
60
75
  gemfile: gemfiles/ruby_2.5.gemfile
61
76
  - rvm: 2.6
62
77
  gemfile: gemfiles/ruby_2.6.gemfile
78
+ - rvm: 2.7
79
+ gemfile: gemfiles/ruby_2.7.gemfile
63
80
  - rvm: jruby-head
64
81
  gemfile: gemfiles/jruby_head.gemfile
65
82
  - rvm: ruby-head
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
 
6
6
  - no changes yet
7
7
 
8
+ ## [1.4.3] - 2020-01-29
9
+
10
+ - [#483](https://github.com/oauth-xx/oauth2/pull/483) - add project metadata to gemspec (@orien)
11
+ - [#495](https://github.com/oauth-xx/oauth2/pull/495) - support additional types of access token requests (@SteveyblamFreeagent, @thomcorley, @dgholz)
12
+ - Adds support for private_key_jwt and tls_client_auth
13
+
8
14
  ## [1.4.2] - 2019-10-01
9
15
 
10
16
  - [#478](https://github.com/oauth-xx/oauth2/pull/478) - support latest version of faraday & fix build (@pboling)
@@ -141,4 +147,6 @@ All notable changes to this project will be documented in this file.
141
147
  [1.3.1]: https://github.com/oauth-xx/oauth2/compare/v1.3.0...v1.3.1
142
148
  [1.4.0]: https://github.com/oauth-xx/oauth2/compare/v1.3.1...v1.4.0
143
149
  [1.4.1]: https://github.com/oauth-xx/oauth2/compare/v1.4.0...v1.4.1
150
+ [1.4.2]: https://github.com/oauth-xx/oauth2/compare/v1.4.1...v1.4.2
151
+ [1.4.3]: https://github.com/oauth-xx/oauth2/compare/v1.4.2...v1.4.3
144
152
  [unreleased]: https://github.com/oauth-xx/oauth2/compare/v1.4.1...HEAD
data/README.md CHANGED
@@ -1,10 +1,25 @@
1
1
  # OAuth2
2
2
 
3
+ If you need the readme for a released version of the gem please find it below:
4
+
5
+ | Version | Release Date | Readme |
6
+ |----------|--------------|----------------------------------------------------------|
7
+ | 1.4.3 | Jan 29, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.3/README.md |
8
+ | 1.4.2 | Oct 1, 2019 | https://github.com/oauth-xx/oauth2/blob/v1.4.2/README.md |
9
+ | 1.4.1 | Oct 13, 2018 | https://github.com/oauth-xx/oauth2/blob/v1.4.1/README.md |
10
+ | 1.4.0 | Jun 9, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.4.0/README.md |
11
+ | 1.3.1 | Mar 3, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.3.1/README.md |
12
+ | 1.3.0 | Dec 27, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.3.0/README.md |
13
+ | 1.2.0 | Jun 30, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.2.0/README.md |
14
+ | 1.1.0 | Jan 30, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.1.0/README.md |
15
+ | 1.0.0 | May 23, 2014 | https://github.com/oauth-xx/oauth2/blob/v1.0.0/README.md |
16
+ | < 1.0.0 | Find here | https://github.com/oauth-xx/oauth2/tags |
17
+
3
18
  [![Gem Version](http://img.shields.io/gem/v/oauth2.svg)][gem]
4
19
  [![Total Downloads](https://img.shields.io/gem/dt/oauth2.svg)][gem]
5
20
  [![Downloads Today](https://img.shields.io/gem/rt/oauth2.svg)][gem]
6
21
  [![Build Status](https://travis-ci.org/oauth-xx/oauth2.svg?branch=1-4-stable)][travis]
7
- [![Coverage Status](http://img.shields.io/coveralls/intridea/oauth2.svg)][coveralls]
22
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/688c612528ff90a46955/test_coverage)][codeclimate-coverage]
8
23
  [![Maintainability](https://api.codeclimate.com/v1/badges/688c612528ff90a46955/maintainability)][codeclimate-maintainability]
9
24
  [![Depfu](https://badges.depfu.com/badges/6d34dc1ba682bbdf9ae2a97848241743/count.svg)][depfu]
10
25
  [![Open Source Helpers](https://www.codetriage.com/oauth-xx/oauth2/badges/users.svg)][code-triage]
@@ -16,10 +31,12 @@
16
31
  [travis]: http://travis-ci.org/oauth-xx/oauth2
17
32
  [coveralls]: https://coveralls.io/r/oauth-xx/oauth2
18
33
  [codeclimate-maintainability]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
34
+ [codeclimate-coverage]: https://codeclimate.com/github/oauth-xx/oauth2/test_coverage
19
35
  [depfu]: https://depfu.com/github/oauth-xx/oauth2
20
36
  [source-license]: https://opensource.org/licenses/MIT
21
37
  [inch-ci]: http://inch-ci.org/github/oauth-xx/oauth2
22
38
  [code-triage]: https://www.codetriage.com/oauth-xx/oauth2
39
+ [fossa1]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_shield
23
40
 
24
41
  A Ruby wrapper for the [OAuth 2.0 specification][oauth2-spec].
25
42
 
@@ -49,7 +66,7 @@ Or install it yourself as:
49
66
 
50
67
  [code]: https://github.com/oauth-xx/oauth2
51
68
  [issues]: https://github.com/oauth-xx/oauth2/issues
52
- [wiki]: https://github.com/oauth-xx/oauth2/wiki
69
+ [wiki]: https://wiki.github.com/oauth-xx/oauth2
53
70
 
54
71
  ## Usage Examples
55
72
 
@@ -66,6 +83,7 @@ response.class.name
66
83
  # => OAuth2::Response
67
84
  ```
68
85
  ## OAuth2::Response
86
+
69
87
  The AccessToken methods #get, #post, #put and #delete and the generic #request
70
88
  will return an instance of the #OAuth2::Response class.
71
89
 
@@ -78,12 +96,14 @@ The original response body, headers, and status can be accessed via their
78
96
  respective methods.
79
97
 
80
98
  ## OAuth2::AccessToken
99
+
81
100
  If you have an existing Access Token for a user, you can initialize an instance
82
101
  using various class methods including the standard new, from_hash (if you have
83
102
  a hash of the values), or from_kvform (if you have an
84
103
  application/x-www-form-urlencoded encoded string of the values).
85
104
 
86
105
  ## OAuth2::Error
106
+
87
107
  On 400+ status code responses, an OAuth2::Error will be raised. If it is a
88
108
  standard OAuth2 error response, the body will be parsed and #code and #description will contain the values provided from the error and
89
109
  error_description parameters. The #response property of OAuth2::Error will
@@ -95,6 +115,7 @@ instance will be returned as usual and on 400+ status code responses, the
95
115
  Response instance will contain the OAuth2::Error instance.
96
116
 
97
117
  ## Authorization Grants
118
+
98
119
  Currently the Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials, and Assertion
99
120
  authentication grant types have helper strategy classes that simplify client
100
121
  use. They are available via the #auth_code, #implicit, #password, #client_credentials, and #assertion methods respectively.
@@ -150,6 +171,7 @@ implementations:
150
171
  - [JRuby 9.2][jruby-9.2] (targets MRI v2.5)
151
172
  - [truffleruby][truffleruby] (targets MRI 2.5)
152
173
  * Ruby 2.6 - Support ends with version 6.x series
174
+ * Ruby 2.7 - Support ends with version 7.x series
153
175
 
154
176
  [jruby-1.7]: https://www.jruby.org/2017/05/11/jruby-1-7-27.html
155
177
  [jruby-9.0]: https://www.jruby.org/2016/01/26/jruby-9-0-5-0.html
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'pry'
5
+ gem 'byebug'
6
+ gem 'pry-byebug'
7
+ end
8
+
9
+ gemspec :path => '../'
@@ -25,6 +25,10 @@ module OAuth2
25
25
  apply_basic_auth(params)
26
26
  when :request_body
27
27
  apply_params_auth(params)
28
+ when :tls_client_auth
29
+ apply_client_id(params)
30
+ when :private_key_jwt
31
+ params
28
32
  else
29
33
  raise NotImplementedError
30
34
  end
@@ -42,6 +46,12 @@ module OAuth2
42
46
  {'client_id' => id, 'client_secret' => secret}.merge(params)
43
47
  end
44
48
 
49
+ # When using schemes that don't require the client_secret to be passed i.e TLS Client Auth,
50
+ # we don't want to send the secret
51
+ def apply_client_id(params)
52
+ { 'client_id' => id }.merge(params)
53
+ end
54
+
45
55
  # Adds an `Authorization` header with Basic Auth credentials if and only if
46
56
  # it is not already set in the params.
47
57
  def apply_basic_auth(params)
@@ -94,9 +94,10 @@ module OAuth2
94
94
  def request(verb, url, opts = {}) # rubocop:disable CyclomaticComplexity, MethodLength, Metrics/AbcSize
95
95
  connection.response :logger, ::Logger.new($stdout) if ENV['OAUTH_DEBUG'] == 'true'
96
96
 
97
- url = connection.build_url(url, opts[:params]).to_s
97
+ url = connection.build_url(url).to_s
98
98
 
99
99
  response = connection.run_request(verb, url, opts[:body], opts[:headers]) do |req|
100
+ req.params.update(opts[:params]) if opts[:params]
100
101
  yield(req) if block_given?
101
102
  end
102
103
  response = Response.new(response, :parse => opts[:parse])
@@ -130,7 +131,7 @@ module OAuth2
130
131
  # @param [Hash] params a Hash of params for the token endpoint
131
132
  # @param [Hash] access token options, to pass to the AccessToken object
132
133
  # @param [Class] class of access token for easier subclassing OAuth2::AccessToken
133
- # @return [AccessToken] the initalized AccessToken
134
+ # @return [AccessToken] the initialized AccessToken
134
135
  def get_token(params, access_token_opts = {}, access_token_class = AccessToken) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
135
136
  params = Authenticator.new(id, secret, options[:auth_scheme]).apply(params)
136
137
  opts = {:raise_errors => options[:raise_errors], :parse => params.delete(:parse)}
@@ -20,7 +20,7 @@ module OAuth2
20
20
  #
21
21
  # @return [Integer]
22
22
  def patch
23
- 2
23
+ 3
24
24
  end
25
25
 
26
26
  # The pre-release version, if any
@@ -22,6 +22,14 @@ Gem::Specification.new do |spec|
22
22
  spec.summary = 'A Ruby wrapper for the OAuth 2.0 protocol.'
23
23
  spec.version = OAuth2::Version
24
24
 
25
+ spec.metadata = {
26
+ 'bug_tracker_uri' => 'https://github.com/oauth-xx/oauth2/issues',
27
+ 'changelog_uri' => "https://github.com/oauth-xx/oauth2/blob/v#{spec.version}/CHANGELOG.md",
28
+ 'documentation_uri' => "https://www.rubydoc.info/gems/oauth2/#{spec.version}",
29
+ 'source_code_uri' => "https://github.com/oauth-xx/oauth2/tree/v#{spec.version}",
30
+ 'wiki_uri' => 'https://github.com/oauth-xx/oauth2/wiki'
31
+ }
32
+
25
33
  spec.require_paths = %w[lib]
26
34
  spec.bindir = 'exe'
27
35
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-10-01 00:00:00.000000000 Z
13
+ date: 2020-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -311,6 +311,7 @@ files:
311
311
  - gemfiles/ruby_2.4.gemfile
312
312
  - gemfiles/ruby_2.5.gemfile
313
313
  - gemfiles/ruby_2.6.gemfile
314
+ - gemfiles/ruby_2.7.gemfile
314
315
  - gemfiles/ruby_head.gemfile
315
316
  - gemfiles/truffleruby.gemfile
316
317
  - lib/oauth2.rb
@@ -331,7 +332,12 @@ files:
331
332
  homepage: https://github.com/oauth-xx/oauth2
332
333
  licenses:
333
334
  - MIT
334
- metadata: {}
335
+ metadata:
336
+ bug_tracker_uri: https://github.com/oauth-xx/oauth2/issues
337
+ changelog_uri: https://github.com/oauth-xx/oauth2/blob/v1.4.3/CHANGELOG.md
338
+ documentation_uri: https://www.rubydoc.info/gems/oauth2/1.4.3
339
+ source_code_uri: https://github.com/oauth-xx/oauth2/tree/v1.4.3
340
+ wiki_uri: https://github.com/oauth-xx/oauth2/wiki
335
341
  post_install_message:
336
342
  rdoc_options: []
337
343
  require_paths:
@@ -347,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
353
  - !ruby/object:Gem::Version
348
354
  version: 1.3.5
349
355
  requirements: []
350
- rubygems_version: 3.0.3
356
+ rubygems_version: 3.1.2
351
357
  signing_key:
352
358
  specification_version: 4
353
359
  summary: A Ruby wrapper for the OAuth 2.0 protocol.