zaikio-oauth_client 0.3.4 → 0.3.5

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: 87237aefe3118d60dbfd8180ef1616274bbd581374bd6e7585e0e2666c5cd72b
4
- data.tar.gz: cab7004abd9c478b79dfa78053cd3e731d0413ae3e909d3791dc7077a4bf811d
3
+ metadata.gz: 18ff86a2a9302a3e1b9b1d26713b63c95d0c88835760d0fd10be57167154d5ec
4
+ data.tar.gz: 1cefd5a0abb861d6a9d2dbdb45c80d9f6ba592b250be72527be9bbaacc924a39
5
5
  SHA512:
6
- metadata.gz: a5e23d82d5ce5497a4ea1b5a8846b3cd1092b288ecc6de3d34d29aa781b978e99c9a524beb126918474894a6a05f3f6b94378fefce9b8f9a7149b3e06780d67d
7
- data.tar.gz: 2fdc1505620138dd80e4ee1caf8f5d9d0ab0d3d5fb7cf6a6af36a6fbb485a6c8a085702c6c47fcdec5aac5a690cb210d8f067ca7cbe458bb2d5a4c3713f6eee9
6
+ metadata.gz: 9d4623a440c5ecb8d989df4757f77fd890d15272d2a8e1af077ec0da77292f488c24f239926072c517803cba22ef750a8f14c66f9f5e765e076136081813f8d6
7
+ data.tar.gz: 1e77a452cc6fa4a2b40be38ede7c5115d36e0e113a682e165c7c7a0ca57c758077644a50d9bbd034275d0ba002344ebd1b5e9b9702f2618712b4801a00498900
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module OAuthClient
3
- VERSION = "0.3.4".freeze
3
+ VERSION = "0.3.5".freeze
4
4
  end
5
5
  end
@@ -8,6 +8,7 @@ module Zaikio
8
8
  module OAuthClient
9
9
  class << self
10
10
  attr_accessor :configuration
11
+ attr_reader :client_name
11
12
 
12
13
  def configure
13
14
  self.configuration ||= Configuration.new
@@ -29,6 +30,13 @@ module Zaikio
29
30
  @oauth_scheme = :request_body
30
31
  end
31
32
 
33
+ def with_client(client_name)
34
+ @client_name = client_name
35
+ yield
36
+ ensure
37
+ @client_name = nil
38
+ end
39
+
32
40
  def with_auth(options_or_access_token, &block)
33
41
  access_token = if options_or_access_token.is_a?(Zaikio::AccessToken)
34
42
  options_or_access_token
@@ -46,6 +54,7 @@ module Zaikio
46
54
  end
47
55
 
48
56
  def get_access_token(client_name: nil, bearer_type: "Person", bearer_id: nil, scopes: nil) # rubocop:disable Metrics/MethodLength
57
+ client_name ||= self.client_name
49
58
  client_config = client_config_for(client_name)
50
59
  scopes ||= client_config.default_scopes_for(bearer_type)
51
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-oauth_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH