http-client-generator 0.1.20 → 0.1.21
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11568b03959898b529b0c5c7fa35c95a3f0501553f84eeff49c088b92fb4c14
|
4
|
+
data.tar.gz: 2a287d40c99b2c217fa5e8679aba6e15179ab9cd0941212a3d2a137d65f2e73d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21e564cdb8cdfaca86807955440d06c14d9d80ebfd2322eb2d79b784f2ca111b6ef46c167e0d7e994b10ae562eb438cdb7d84155cd6dd7e39ac6366db45b80bd
|
7
|
+
data.tar.gz: 7575ecc971dc44da55858f14d39dd32fcc5cb78b7f6b9be54884737634a8e08274899ab81318b0746646c9fd1ed8f9b20f1001809c5fe8793a378023b4e2a2f2
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module HttpClientGenerator
|
4
|
+
class Plugs
|
5
|
+
class SetBearerToken
|
6
|
+
Plugs.register :set_bearer_token, self
|
7
|
+
|
8
|
+
def initialize(from_arg:)
|
9
|
+
@from_arg = from_arg
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(req)
|
13
|
+
token = req.rest_args[@from_arg]
|
14
|
+
|
15
|
+
req.headers[:authorization] = "Bearer #{token}"
|
16
|
+
|
17
|
+
req
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-client-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Egorov
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/http_client_generator/plugs/camelize_body.rb
|
52
52
|
- lib/http_client_generator/plugs/encode_json_response.rb
|
53
53
|
- lib/http_client_generator/plugs/enforce_json_response.rb
|
54
|
+
- lib/http_client_generator/plugs/set_bearer_token.rb
|
54
55
|
- lib/http_client_generator/plugs/set_header.rb
|
55
56
|
- lib/http_client_generator/plugs/set_request_id.rb
|
56
57
|
- lib/http_client_generator/plugs/underscore_response.rb
|