oauth2c 1.0.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: 053d69504969a4da1cf39cbad0cdf25fe688f527596ff3a7c3eff53eb66ed23a
4
- data.tar.gz: d656779a1685132c2a937100521eb6787e8f6dc7ba440446e975844a3547367b
3
+ metadata.gz: 119083bad261124505a0b2bc3625c95b3ebc33cbc8551a881f3ce851080a868e
4
+ data.tar.gz: aad20285a99bcd72ac24f48bcdae7489fb6b999707ca8758faa8a2a4c5fa96bc
5
5
  SHA512:
6
- metadata.gz: 0f93d274c89a3a4e41a1cf21066c711fef465c99fffdce24cb2eefcf0ce8683f8d8df1c68579146d9d68c0266baa2da164909ef8ad96a4be642718b2f2deee7e
7
- data.tar.gz: 61a504ac71a4c108b3973db6be7293cfe97298c3ffe3be591c2307ebd6487f7929713a8ed2859a75e97a24d006d3811e1cf2eee083296e937815f14a5a515e0c
6
+ metadata.gz: e5c1c87d0ede559cfec78667e1642195a273a31f7875759a372ea3a9118966eb684ec14df0a47e3f1cad77e5a40b0d3133d499baa1e51d4997ad0777590f0a01
7
+ data.tar.gz: 0ebd17c7870a31f910e7ad653d47c7a8845398bd15f848dd319060697f780ddf8d66e97cabf3077474f814fbbeb910c5a3e25b400df9db0c79dde474400aaf7e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
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
+
1
7
  ## 1.0.0 - 01/28/2019
2
8
  * Allow newer http gem dependency (#3)
3
9
  * Drop support for Ruby 2.2 and earlier
data/lib/oauth2c/agent.rb CHANGED
@@ -33,12 +33,24 @@ module OAuth2c
33
33
 
34
34
  @http_client = HTTP.nodelay
35
35
  .accept("application/json")
36
- .headers("Content-Type": "application/x-www-form-urlencoded; encoding=UTF-8")
36
+ .headers(
37
+ "Content-Type": "application/x-www-form-urlencoded; encoding=UTF-8",
38
+ "User-Agent": user_agent_header
39
+ )
37
40
  unless @client_credentials_on_body
38
41
  @http_client = @http_client.basic_auth(user: @client_id, pass: @client_secret)
39
42
  end
40
43
  end
41
44
 
45
+ def user_agent_header
46
+ gem_name = "oauth2c"
47
+ gem_version = OAuth2c::VERSION
48
+ app_name = ENV.fetch("APP_NAME", nil) # rubocop:disable Env/OutsideConfig, Env/UndefinedVar
49
+ formatted_app_name = (app_name ? " (#{app_name})" : "")
50
+
51
+ "#{gem_name}/#{gem_version}#{formatted_app_name}"
52
+ end
53
+
42
54
  def authz_url(response_type:, state:, scope: [], **params)
43
55
  if @authz_url.nil?
44
56
  raise ConfigError, "authz_url not informed for client"
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module OAuth2c
16
- VERSION = '1.0.0'.freeze
16
+ VERSION = '1.1.1'.freeze
17
17
  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.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doximity
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2020-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  version: '0'
199
199
  requirements: []
200
200
  rubyforge_project:
201
- rubygems_version: 2.7.7
201
+ rubygems_version: 2.7.6
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: OAuth2c is a extensible OAuth2 client implementation