gapic-common 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/gapic/common/version.rb +1 -1
- data/lib/gapic/rest/faraday_middleware.rb +25 -4
- data/lib/gapic/rest/threaded_enumerator.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea69666c3f5162e9949825974c29af5ca636527a25e67d0ce034c2bb6c39b201
|
4
|
+
data.tar.gz: 68df57288727233549f5ababcd296b545bd4a1e10bdc29caae1891019c3995ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c83345123a2739aa89f31aefb00288c8ae7e831af653a654872601a2e646ddd9b7d7356aa82e403b5c2571cae2bd437fbf4ff8c38e70822cfc18c89ea89f883
|
7
|
+
data.tar.gz: a95b2ec76934bec8140e6c65b627644833143f313117cd86d867dcda0e3bfdf00407f86c8b33d0f52165de5549c3207119a8b5b506cba5b9da8c41a58846cf78
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.14.0 (2022-11-08)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* add support for different types of credentials to REST
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* deadlock fix ([#845](https://github.com/googleapis/gapic-generator-ruby/issues/845))
|
11
|
+
|
3
12
|
### 0.13.0 (2022-10-26)
|
4
13
|
|
5
14
|
#### Features
|
data/lib/gapic/common/version.rb
CHANGED
@@ -18,22 +18,43 @@ module Gapic
|
|
18
18
|
# Registers the middleware with Faraday
|
19
19
|
module FaradayMiddleware
|
20
20
|
##
|
21
|
+
# @private
|
21
22
|
# Request middleware that constructs the Authorization HTTP header
|
22
23
|
# using ::Google::Auth::Credentials
|
23
24
|
#
|
24
25
|
class GoogleAuthorization < Faraday::Middleware
|
25
26
|
##
|
27
|
+
# @private
|
26
28
|
# @param app [#call]
|
27
|
-
# @param credentials [
|
29
|
+
# @param credentials [Google::Auth::Credentials, Signet::OAuth2::Client, Symbol, Proc]
|
30
|
+
# Provides the means for authenticating requests made by
|
31
|
+
# the client. This parameter can be many types:
|
32
|
+
# * A `Google::Auth::Credentials` uses a the properties of its represented keyfile for authenticating requests
|
33
|
+
# made by this client.
|
34
|
+
# * A `Signet::OAuth2::Client` object used to apply the OAuth credentials.
|
35
|
+
# * A `Proc` will be used as an updater_proc for the auth token.
|
36
|
+
# * A `Symbol` is treated as a signal that authentication is not required.
|
37
|
+
#
|
28
38
|
def initialize app, credentials
|
29
|
-
@
|
39
|
+
@updater_proc = case credentials
|
40
|
+
when Symbol
|
41
|
+
credentials
|
42
|
+
else
|
43
|
+
updater_proc = credentials.updater_proc if credentials.respond_to? :updater_proc
|
44
|
+
updater_proc ||= credentials if credentials.is_a? Proc
|
45
|
+
raise ArgumentError, "invalid credentials (#{credentials.class})" if updater_proc.nil?
|
46
|
+
updater_proc
|
47
|
+
end
|
30
48
|
super app
|
31
49
|
end
|
32
50
|
|
51
|
+
# @private
|
33
52
|
# @param env [Faraday::Env]
|
34
53
|
def call env
|
35
|
-
|
36
|
-
|
54
|
+
unless @updater_proc.is_a? Symbol
|
55
|
+
auth_hash = @updater_proc.call({})
|
56
|
+
env.request_headers["Authorization"] = auth_hash[:authorization]
|
57
|
+
end
|
37
58
|
|
38
59
|
@app.call env
|
39
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gapic-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google API Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|