oauth2_api_client 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +6 -0
- data/lib/oauth2_api_client/version.rb +1 -1
- data/lib/oauth2_api_client.rb +1 -1
- data/oauth2_api_client.gemspec +0 -6
- data/spec/oauth2_api_client_spec.rb +13 -0
- metadata +2 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf92b6840d7440d512d8d0b7586acfe9751c38e6c99e4ab9f83cd9893cf9f13e
|
4
|
+
data.tar.gz: 2e79b922b01af914adef3bacc2f415af62d26e3c8ad95b699daa63147842410a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b782f564cde4d121868f274946df14af27ab13d7e1d501367451b571ada534696027c8ae51e8705315ad35a5a43b04d800d3209a6c70a6eaedf0a1a5f077ca1
|
7
|
+
data.tar.gz: f2c3a469a6a189c6a0c986182ab2a53eb268a851882406d1d7de00cc32556f5a7ebb9e9dcc6732fd370ff9ce905a90a714ddea0649e33ada8eeea2dcb7a74be7
|
data/.github/workflows/test.yml
CHANGED
@@ -7,12 +7,12 @@ jobs:
|
|
7
7
|
fail-fast: false
|
8
8
|
matrix:
|
9
9
|
ruby:
|
10
|
-
- 2.
|
11
|
-
-
|
12
|
-
- 3.
|
10
|
+
- "2.7"
|
11
|
+
- "3.0"
|
12
|
+
- "3.1"
|
13
13
|
steps:
|
14
14
|
- uses: actions/checkout@v1
|
15
|
-
- uses:
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
17
|
ruby-version: ${{ matrix.ruby }}
|
18
18
|
- run: gem install bundler
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/oauth2_api_client.rb
CHANGED
@@ -72,7 +72,7 @@ class Oauth2ApiClient
|
|
72
72
|
ruby2_keywords method
|
73
73
|
end
|
74
74
|
|
75
|
-
[:get, :post, :put, :delete, :head, :options].each do |method|
|
75
|
+
[:get, :post, :put, :patch, :delete, :head, :options].each do |method|
|
76
76
|
define_method method do |path, options = {}|
|
77
77
|
execute(method, path, options)
|
78
78
|
end
|
data/oauth2_api_client.gemspec
CHANGED
@@ -17,12 +17,6 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_development_dependency "bundler"
|
21
|
-
spec.add_development_dependency "rspec"
|
22
|
-
spec.add_development_dependency "rubocop"
|
23
|
-
spec.add_development_dependency "timecop"
|
24
|
-
spec.add_development_dependency "webmock"
|
25
|
-
|
26
20
|
spec.add_dependency "activesupport"
|
27
21
|
spec.add_dependency "http"
|
28
22
|
spec.add_dependency "oauth2", ">= 1.4.2"
|
@@ -140,6 +140,19 @@ RSpec.describe Oauth2ApiClient do
|
|
140
140
|
expect(client.get("/path", params: { key: "value" }).to_s).to eq("ok")
|
141
141
|
end
|
142
142
|
|
143
|
+
[:get, :post, :put, :patch, :delete, :head, :options].each do |method|
|
144
|
+
describe "##{method}" do
|
145
|
+
it "calls with body" do
|
146
|
+
stub_request(method, "http://localhost/api/path").with(body: { key: "value" }.to_json)
|
147
|
+
.to_return(status: 200, body: "ok")
|
148
|
+
|
149
|
+
client = described_class.new(base_url: "http://localhost/api", token: "token")
|
150
|
+
|
151
|
+
expect(client.send(method, "/path", headers: { "Content-Type" => "application/json" }, body: { key: "value" }.to_json).to_s).to eq("ok")
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
143
156
|
it "passes the token in the authorization header" do
|
144
157
|
stub_request(:get, "http://localhost/api/path")
|
145
158
|
.with(headers: { "Authorization" => "Bearer access_token" })
|
metadata
CHANGED
@@ -1,85 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Vetter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rspec
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: timecop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: webmock
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
13
|
- !ruby/object:Gem::Dependency
|
84
14
|
name: activesupport
|
85
15
|
requirement: !ruby/object:Gem::Requirement
|