oauth2c 1.1.1 → 1.2.0.pre

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: 119083bad261124505a0b2bc3625c95b3ebc33cbc8551a881f3ce851080a868e
4
- data.tar.gz: aad20285a99bcd72ac24f48bcdae7489fb6b999707ca8758faa8a2a4c5fa96bc
3
+ metadata.gz: 37894399e3c3c2e3ad75f4fbd57d8ccb63375d9c83630e19cc590046bb34170c
4
+ data.tar.gz: 0e98320878f501b2eaef231ae14c8300906b76c189ecc010e0c16a9b42ed99ce
5
5
  SHA512:
6
- metadata.gz: e5c1c87d0ede559cfec78667e1642195a273a31f7875759a372ea3a9118966eb684ec14df0a47e3f1cad77e5a40b0d3133d499baa1e51d4997ad0777590f0a01
7
- data.tar.gz: 0ebd17c7870a31f910e7ad653d47c7a8845398bd15f848dd319060697f780ddf8d66e97cabf3077474f814fbbeb910c5a3e25b400df9db0c79dde474400aaf7e
6
+ metadata.gz: 7773aebcb978c0f949744c98e4826f8d31f992a3dcf5f9f0087cc4aa3877666fd0dbc335aed5836a0a4bb8cb5a01769216d46d4045c859e4f97239e3e1083691
7
+ data.tar.gz: 8152904ebe65f3869cc74549632629e7813c53008a92b10f47979741b8866697d5963547351c7b05536fbf5a6624cb404b097e662becadaec597fd4d05151396
@@ -0,0 +1,144 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ gem: doximity/gem-publisher@0
5
+
6
+ executors:
7
+ ruby-2-7:
8
+ resource_class: small
9
+ docker:
10
+ - image: cimg/ruby:2.7
11
+ environment:
12
+ BUNDLE_VERSION: "~> 2.3"
13
+
14
+ # yaml anchor filters
15
+ master_only: &master_only
16
+ filters:
17
+ branches:
18
+ only: master
19
+ tags:
20
+ ignore: /.*/
21
+ pr_only: &pr_only
22
+ filters:
23
+ branches:
24
+ ignore: master
25
+ tags:
26
+ ignore: /.*/
27
+ version_tags_only: &version_tags_only
28
+ filters:
29
+ branches:
30
+ ignore: /.*/
31
+ tags:
32
+ only: /^v.*/
33
+
34
+ jobs:
35
+ build:
36
+ executor: ruby-2-7
37
+ steps:
38
+ - checkout
39
+ - run:
40
+ name: Install Dependencies
41
+ command: |
42
+ gem install bundler --version "${BUNDLE_VERSION}" --force
43
+ bundle config set --local jobs '4'
44
+ bundle config set --local retry '3'
45
+ bundle install --local
46
+ - run:
47
+ name: Build documentation
48
+ command: bundle exec rake ci:doc
49
+ - store_artifacts:
50
+ name: Saves documentation
51
+ path: doc
52
+
53
+ future_version_multivariant:
54
+ parameters:
55
+ ruby-version:
56
+ type: string
57
+ resource_class: small
58
+ description: "Rb << parameters.ruby-version >>"
59
+ docker:
60
+ - image: cimg/ruby:<< parameters.ruby-version >>
61
+ environment:
62
+ BUNDLE_VERSION: "2.3.17"
63
+ steps:
64
+ - checkout
65
+ - run:
66
+ name: Configure Bundler
67
+ command: |
68
+ gem install bundler --version "${BUNDLE_VERSION}" --force
69
+ bundle config set --local jobs '4'
70
+ bundle config set --local retry '3'
71
+ - run:
72
+ name: Local Bundle Install
73
+ command: bundle install --local
74
+ - run:
75
+ name: Run Tests
76
+ command: ruby -v && bundle exec rake ci:specs
77
+ - store_test_results:
78
+ name: Store test results
79
+ path: tmp/test-results
80
+
81
+ workflows:
82
+ version: 2
83
+
84
+ trunk:
85
+ jobs:
86
+ - build:
87
+ <<: *master_only
88
+ - gem/build:
89
+ <<: *master_only
90
+ executor: ruby-2-7
91
+ name: gem-build
92
+ requires:
93
+ - build
94
+
95
+ pull-requests:
96
+ jobs:
97
+ - future_version_multivariant:
98
+ <<: *pr_only
99
+ name: "Rb << matrix.ruby-version >>"
100
+ context: nexus_readonly
101
+ matrix:
102
+ parameters:
103
+ ruby-version: [ "2.7.6", "3.0.3", "3.1.2" ]
104
+ - build:
105
+ <<: *pr_only
106
+ - gem/build:
107
+ <<: *pr_only
108
+ executor: ruby-2-7
109
+ name: gem-build
110
+ requires:
111
+ - future_version_multivariant
112
+ - build
113
+ - pre-release-approval:
114
+ <<: *pr_only
115
+ type: approval
116
+ requires:
117
+ - gem-build
118
+ - gem/publish:
119
+ <<: *pr_only
120
+ name: gem-publish
121
+ to_rubygems: true
122
+ pre_release: true
123
+ requires:
124
+ - pre-release-approval
125
+ context: artifact_publishing
126
+
127
+ final-release:
128
+ jobs:
129
+ - build:
130
+ <<: *version_tags_only
131
+ - gem/build:
132
+ <<: *version_tags_only
133
+ executor: ruby-2-7
134
+ name: gem-build
135
+ requires:
136
+ - build
137
+ - gem/publish:
138
+ <<: *version_tags_only
139
+ name: gem-publish
140
+ to_rubygems: true
141
+ pre_release: false
142
+ requires:
143
+ - gem-build
144
+ context: artifact_publishing
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
+ .rspec_status
2
+ /*.gem
1
3
  /.bundle/
4
+ /.ruby-version
2
5
  /.yardoc
3
- /Gemfile.lock
4
6
  /_yardoc/
5
7
  /coverage/
6
8
  /doc/
7
9
  /pkg/
8
10
  /spec/reports/
9
11
  /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
12
+ /vendor/bundle/
data/CHANGELOG.md CHANGED
@@ -1,37 +1,56 @@
1
- ## 1.1.1 01/16/2020
2
- * Removed doximity references from code
3
-
4
- ## 1.1.0 - 12/16/2019
5
- * Set User-Agent header on agent requests
6
-
7
- ## 1.0.0 - 01/28/2019
8
- * Allow newer http gem dependency (#3)
9
- * Drop support for Ruby 2.2 and earlier
10
-
11
- ## 0.3.0 - 09/21/2017
12
- * Allow doing auth over body params, instead of basic auth (header) (#1)
13
-
14
- ## 0.2.1 - 04/18/2017
15
- * Fix issue JWT with nbf claim one second in the past
16
-
17
- ## 0.2.0 - 04/14/2017
18
- * Update README with list of cache backends
19
- * Fix manager delegate for client attrs
20
- * Add support for default_scope
21
- * Fix manager call to cache layer
22
- * Don't cache with nil key
23
- * Fix RefreshToken and ResourceOwnerCredentials initializer
24
- * Only cache token when key is not nil
25
- * Return nil from cached, not false
26
- * Add exp leeway to cache expiration
27
- * Dynamically define methods for OAuth2c::Client
28
- * Define respond_to_missing? for OAuth2::Cache::Manager
29
- * Allow three legged token method to receive hash with params
30
- * Allow expires_at to be set on access token
31
- * Add expired? with leeway support to AccessToken
32
- * Define comparison operator for AccessToken to return false for other class
33
- * Properly convert time for access token to handle serialization
34
-
35
-
36
- ## 0.1.0 - 03/10/2017
37
- * Initial release
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.2.0.pre] - 2022-08-19
8
+ - Add support for ruby3/ruby 2.7
9
+
10
+ ## [1.1.2] - 2020-02-24
11
+ ### Changed
12
+ - Release on RubyGems using gem-publisher CircleCI Orb
13
+ - Build doc and make it available on CircleCI's build artifacts
14
+ - Packing gems
15
+
16
+ ## [1.1.1] 2020-01-16
17
+ ### Changed
18
+ - Removed doximity references from code
19
+
20
+ ## [1.1.0] - 2019-12-16
21
+ ### Added
22
+ - Set User-Agent header on agent requests
23
+
24
+ ## [1.0.0] - 2019-01-28
25
+ ### Changed
26
+ - Allow newer http gem dependency (#3)
27
+ - Drop support for Ruby 2.2 and earlier
28
+
29
+ ## [0.3.0] - 2017-09-21
30
+ ### Changed
31
+ - Allow doing auth over body params, instead of basic auth (header) (#1)
32
+
33
+ ## [0.2.1] - 2017-04-18
34
+ ### Changed
35
+ - Fix issue JWT with nbf claim one second in the past
36
+
37
+ ## [0.2.0] - 2017-04-14
38
+ - Update README with list of cache backends
39
+ - Fix manager delegate for client attrs
40
+ - Add support for default_scope
41
+ - Fix manager call to cache layer
42
+ - Don't cache with nil key
43
+ - Fix RefreshToken and ResourceOwnerCredentials initializer
44
+ - Only cache token when key is not nil
45
+ - Return nil from cached, not false
46
+ - Add exp leeway to cache expiration
47
+ - Dynamically define methods for OAuth2c::Client
48
+ - Define respond_to_missing? for OAuth2::Cache::Manager
49
+ - Allow three legged token method to receive hash with params
50
+ - Allow expires_at to be set on access token
51
+ - Add expired? with leeway support to AccessToken
52
+ - Define comparison operator for AccessToken to return false for other class
53
+ - Properly convert time for access token to handle serialization
54
+
55
+ ## [0.1.0] - 2017-03-10
56
+ - Initial release
data/Gemfile.lock ADDED
@@ -0,0 +1,88 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ oauth2c (1.2.0.pre)
5
+ http (~> 4)
6
+ jwt (~> 1.5)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ byebug (11.1.1)
14
+ coderay (1.1.2)
15
+ crack (0.4.3)
16
+ safe_yaml (~> 1.0.0)
17
+ diff-lcs (1.3)
18
+ domain_name (0.5.20190701)
19
+ unf (>= 0.0.5, < 1.0.0)
20
+ ffi (1.12.2)
21
+ ffi-compiler (1.0.1)
22
+ ffi (>= 1.0.0)
23
+ rake
24
+ hashdiff (1.0.0)
25
+ http (4.3.0)
26
+ addressable (~> 2.3)
27
+ http-cookie (~> 1.0)
28
+ http-form_data (~> 2.2)
29
+ http-parser (~> 1.2.0)
30
+ http-cookie (1.0.3)
31
+ domain_name (~> 0.5)
32
+ http-form_data (2.2.0)
33
+ http-parser (1.2.1)
34
+ ffi-compiler (>= 1.0, < 2.0)
35
+ jwt (1.5.6)
36
+ method_source (0.9.2)
37
+ pry (0.12.2)
38
+ coderay (~> 1.1.0)
39
+ method_source (~> 0.9.0)
40
+ public_suffix (4.0.3)
41
+ rake (13.0.1)
42
+ rdoc (6.2.1)
43
+ redis (4.1.3)
44
+ rexml (3.2.5)
45
+ rspec (3.9.0)
46
+ rspec-core (~> 3.9.0)
47
+ rspec-expectations (~> 3.9.0)
48
+ rspec-mocks (~> 3.9.0)
49
+ rspec-core (3.9.1)
50
+ rspec-support (~> 3.9.1)
51
+ rspec-expectations (3.9.0)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.9.0)
54
+ rspec-mocks (3.9.1)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.9.0)
57
+ rspec-support (3.9.2)
58
+ rspec_junit_formatter (0.4.1)
59
+ rspec-core (>= 2, < 4, != 2.12.0)
60
+ safe_yaml (1.0.5)
61
+ sdoc (1.0.0)
62
+ rdoc (>= 5.0)
63
+ unf (0.1.4)
64
+ unf_ext
65
+ unf_ext (0.0.7.6)
66
+ webmock (3.8.2)
67
+ addressable (>= 2.3.6)
68
+ crack (>= 0.3.2)
69
+ hashdiff (>= 0.4.0, < 2.0.0)
70
+
71
+ PLATFORMS
72
+ ruby
73
+
74
+ DEPENDENCIES
75
+ bundler (~> 2.3)
76
+ byebug
77
+ oauth2c!
78
+ pry
79
+ rake
80
+ redis
81
+ rexml
82
+ rspec
83
+ rspec_junit_formatter
84
+ sdoc
85
+ webmock
86
+
87
+ BUNDLED WITH
88
+ 2.3.20
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
- require "bundler/gem_tasks"
1
+ # frozen_string_literal: true
2
+
2
3
  require "rspec/core/rake_task"
3
4
 
5
+ FileList["tasks/*.rake"].each { |task| load task }
6
+
4
7
  RSpec::Core::RakeTask.new(:spec)
5
8
 
6
- task :default => :spec
9
+ task default: :spec
@@ -21,7 +21,7 @@ module OAuth2c
21
21
  { response_type: "code" }
22
22
  end
23
23
 
24
- def token_params(code:, **_)
24
+ def token_params(*args, code:, **_)
25
25
  { grant_type: "authorization_code", code: code }
26
26
  end
27
27
  end
@@ -56,7 +56,7 @@ module OAuth2c
56
56
  if block_given?
57
57
  yield(query_params, fragment_params)
58
58
  else
59
- ok, response = @agent.token(include_redirect_uri: true, **token_params(query_params))
59
+ ok, response = @agent.token(include_redirect_uri: true, **token_params(**query_params))
60
60
  handle_token_response(ok, response)
61
61
  end
62
62
  end
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module OAuth2c
16
- VERSION = '1.1.1'.freeze
16
+ VERSION = '1.2.0.pre'.freeze
17
17
  end
data/oauth2c.gemspec CHANGED
@@ -28,19 +28,10 @@ Gem::Specification.new do |spec|
28
28
  spec.description = %q{OAuth2c is a extensible OAuth2 client implementation}
29
29
  spec.homepage = "https://github.com/doximity/oauth2c"
30
30
 
31
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
32
- # to allow pushing to a single host or delete this section to allow pushing to any host.
33
- # if spec.respond_to?(:metadata)
34
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
35
- # else
36
- # raise "RubyGems 2.0 or newer is required to protect against " \
37
- # "public gem pushes."
38
- # end
39
-
40
31
  spec.required_ruby_version = ">= 2.3.0"
41
32
 
42
33
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
43
- f.match(%r{^(test|spec|features)/})
34
+ f.match(%r{^(bin|test|spec|features|vendor|tasks|tmp)/})
44
35
  end
45
36
 
46
37
  spec.bindir = "exe"
@@ -50,11 +41,14 @@ Gem::Specification.new do |spec|
50
41
  spec.add_runtime_dependency "http", "~> 4"
51
42
  spec.add_runtime_dependency "jwt", "~> 1.5"
52
43
 
53
- spec.add_development_dependency "bundler"
54
- spec.add_development_dependency "pry"
44
+ spec.add_development_dependency "bundler", "~> 2.3"
55
45
  spec.add_development_dependency "byebug"
46
+ spec.add_development_dependency "pry"
56
47
  spec.add_development_dependency "rake"
57
48
  spec.add_development_dependency "redis"
58
49
  spec.add_development_dependency "rspec"
50
+ spec.add_development_dependency "rspec_junit_formatter"
51
+ spec.add_development_dependency "sdoc"
59
52
  spec.add_development_dependency "webmock"
53
+ spec.add_development_dependency "rexml"
60
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doximity
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
11
+ date: 2022-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -40,6 +40,20 @@ dependencies:
40
40
  version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: byebug
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: byebug
84
+ name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -81,7 +95,7 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: rake
98
+ name: redis
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ">="
@@ -95,7 +109,7 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
- name: redis
112
+ name: rspec
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
@@ -109,7 +123,21 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
- name: rspec
126
+ name: rspec_junit_formatter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: sdoc
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - ">="
@@ -136,6 +164,20 @@ dependencies:
136
164
  - - ">="
137
165
  - !ruby/object:Gem::Version
138
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rexml
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
139
181
  description: OAuth2c is a extensible OAuth2 client implementation
140
182
  email:
141
183
  - engineering@doximity.com
@@ -143,18 +185,17 @@ executables: []
143
185
  extensions: []
144
186
  extra_rdoc_files: []
145
187
  files:
188
+ - ".circleci/config.yml"
146
189
  - ".gitignore"
147
190
  - ".rspec"
148
191
  - ".travis.yml"
149
192
  - CHANGELOG.md
150
193
  - CODE_OF_CONDUCT.md
151
194
  - Gemfile
195
+ - Gemfile.lock
152
196
  - LICENSE.txt
153
197
  - README.md
154
198
  - Rakefile
155
- - bin/console
156
- - bin/rspec
157
- - bin/setup
158
199
  - lib/oauth2c.rb
159
200
  - lib/oauth2c/access_token.rb
160
201
  - lib/oauth2c/agent.rb
@@ -193,12 +234,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
234
  version: 2.3.0
194
235
  required_rubygems_version: !ruby/object:Gem::Requirement
195
236
  requirements:
196
- - - ">="
237
+ - - ">"
197
238
  - !ruby/object:Gem::Version
198
- version: '0'
239
+ version: 1.3.1
199
240
  requirements: []
200
- rubyforge_project:
201
- rubygems_version: 2.7.6
241
+ rubygems_version: 3.3.11
202
242
  signing_key:
203
243
  specification_version: 4
204
244
  summary: OAuth2c is a extensible OAuth2 client implementation
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "oauth2c"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- require "pry"
11
- Pry.start
12
-
13
- # require "irb"
14
- # IRB.start(__FILE__)
data/bin/rspec DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- #
4
- # This file was generated by Bundler.
5
- #
6
- # The application 'rspec' is installed as part of a gem, and
7
- # this file is here to facilitate running it.
8
- #
9
-
10
- require "pathname"
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
- Pathname.new(__FILE__).realpath)
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("rspec-core", "rspec")
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here