oauth2_api_client 3.1.0 → 3.1.1
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 +21 -0
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/oauth2_api_client/response_error.rb +2 -0
- data/lib/oauth2_api_client/version.rb +1 -1
- data/lib/oauth2_api_client.rb +2 -3
- data/oauth2_api_client.gemspec +1 -1
- metadata +9 -9
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33e0e15f43fe027760355c1a403da0d02b30412b064984102234744fc8da65b7
|
4
|
+
data.tar.gz: bf10a1428e0a797daa31f32b7712d2525eddab710c2ba12d244e95b968489314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46dbbbd595379cc1217f272247149d0ce8084651704c2264301e28dcc8ece22b2c8cc2b9b108d38140eaf1f46145cfde1fb600e24a5434f00a013948e79b22c3
|
7
|
+
data.tar.gz: d3b38d88ac90e9550971f5320b5cca814be87ade495a8bd999047faebd310f41beecbe45ac16e35fd2ba1e54bbea7b443f13f670e1c119e3a08931b6ea7476ef
|
@@ -0,0 +1,21 @@
|
|
1
|
+
on: push
|
2
|
+
name: test
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
strategy:
|
7
|
+
fail-fast: false
|
8
|
+
matrix:
|
9
|
+
ruby:
|
10
|
+
- 2.6
|
11
|
+
- 2.7
|
12
|
+
- 3.0
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v1
|
15
|
+
- uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
- run: gem install bundler
|
19
|
+
- run: bundle
|
20
|
+
- run: bundle exec rspec
|
21
|
+
- run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# oauth2_api_client
|
2
2
|
|
3
|
-
[![Build
|
3
|
+
[![Build](https://github.com/mrkamel/oauth2_api_client/workflows/test/badge.svg)](https://github.com/mrkamel/oauth2_api_client/actions?query=workflow%3Atest+branch%3Amaster)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/oauth2_api_client.svg)](http://badge.fury.io/rb/oauth2_api_client)
|
5
5
|
|
6
6
|
Oauth2ApiClient is a small, but powerful client around
|
@@ -12,7 +12,7 @@ oauth2 for authentication.
|
|
12
12
|
client = Oauth2ApiClient.new(base_url: "https://api.example.com", token "oauth2 token")
|
13
13
|
|
14
14
|
client.post("/orders", json: { address: "..." }).status.success?
|
15
|
-
client.headers("User-Agent" => "API Client").timeout(read: 5, write: 5).get("/orders").parse
|
15
|
+
client.headers("User-Agent" => "API Client").timeout(read: 5, write: 5).get("/orders").parse(:json)
|
16
16
|
# ...
|
17
17
|
```
|
18
18
|
|
data/lib/oauth2_api_client.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require "ruby2_keywords"
|
2
2
|
require "oauth2"
|
3
3
|
require "http"
|
4
|
-
require "ruby2_keywords"
|
5
4
|
require "active_support"
|
6
5
|
|
7
6
|
require "oauth2_api_client/version"
|
@@ -28,7 +27,7 @@ class Oauth2ApiClient
|
|
28
27
|
# )
|
29
28
|
#
|
30
29
|
# client.post("/orders", json: { address: "..." }).status.success?
|
31
|
-
# client.headers("User-Agent" => "API Client").timeout(read: 5, write: 5).get("/orders").parse
|
30
|
+
# client.headers("User-Agent" => "API Client").timeout(read: 5, write: 5).get("/orders").parse(:json)
|
32
31
|
#
|
33
32
|
# @example
|
34
33
|
# client = Oauth2ApiClient.new(
|
@@ -41,7 +40,7 @@ class Oauth2ApiClient
|
|
41
40
|
# )
|
42
41
|
# )
|
43
42
|
|
44
|
-
def initialize(base_url:, base_request: HTTP
|
43
|
+
def initialize(base_url:, token:, base_request: HTTP)
|
45
44
|
@base_url = base_url
|
46
45
|
@token = token
|
47
46
|
@request = base_request
|
data/oauth2_api_client.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Vetter
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 1.4.2
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 1.4.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: ruby2_keywords
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,9 +144,9 @@ executables: []
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
+
- ".github/workflows/test.yml"
|
147
148
|
- ".gitignore"
|
148
149
|
- ".rubocop.yml"
|
149
|
-
- ".travis.yml"
|
150
150
|
- CHANGELOG.md
|
151
151
|
- Gemfile
|
152
152
|
- LICENSE.txt
|
@@ -165,7 +165,7 @@ homepage: https://github.com/mrkamel/oauth2_api_client
|
|
165
165
|
licenses:
|
166
166
|
- MIT
|
167
167
|
metadata: {}
|
168
|
-
post_install_message:
|
168
|
+
post_install_message:
|
169
169
|
rdoc_options: []
|
170
170
|
require_paths:
|
171
171
|
- lib
|
@@ -180,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
-
signing_key:
|
183
|
+
rubygems_version: 3.3.3
|
184
|
+
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: Small but powerful client around oauth2 and http-rb to interact with APIs
|
187
187
|
test_files:
|