oauth_im 0.15.0 → 0.15.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96a52f6e8d59737439a315eb6b64a883dc8c8a8680d4b1a136b98fdd042eb4f7
4
- data.tar.gz: 04cbae317291c2a9f16b20f41bd8e394ef52ebbfbdd132eb474b768110de9bca
3
+ metadata.gz: 4749aa8af3a4a6985c6d1d75993628037546650a37763713dc832a2c8e42336e
4
+ data.tar.gz: 9bb51b3e52a787b8983a2de1eb979e2e60175bef2627cfbfb9b395101de17133
5
5
  SHA512:
6
- metadata.gz: 125503e2251bcab4b98933f45f8533798cc8ebb808207c3df9ffaeba40b3640db8888638b2a319b9edf3f0a71a4f281600ffbf0c899d380ed42f70c754a5b1f9
7
- data.tar.gz: aa3935aa8ec9b3a974931813a15f484d52e24204ba8bf71a70d042152e003a66ec1b5d5e427842b8c7901ff1d53866460950607f823a78eb77108c323a60c64c
6
+ metadata.gz: 053b4ff02c5542685dfabd6d58dfd2a0effc15f40a407b91674028b785f5238a88ff8530d2b8182d34bcce5847fa37a8a421643494a7de27873b8594dd4d3216
7
+ data.tar.gz: 6453b5f666529f3b8d4323e2899bf9bf03d7bb527accde2195479d84504b6c6adf08398920dad800ebbbce984be87060fb52e35724633a9aa4d0f21872d6a7bf
@@ -2,16 +2,30 @@
2
2
 
3
3
  module OauthIm
4
4
  class Client
5
- def self.for(request: nil, user_jwt: nil, secure_id: nil)
5
+ # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
6
+ def self.for(request: nil,
7
+ user_jwt: nil,
8
+ secure_id: nil,
9
+ client_id: nil,
10
+ api_key: nil,
11
+ idp_url: nil)
6
12
  if request.present?
7
- RequestClient.new request: request
13
+ RequestClient.new request: request,
14
+ client_id: client_id,
15
+ idp_url: idp_url
8
16
  elsif user_jwt.present?
9
- UserClient.new user_jwt: user_jwt
17
+ UserClient.new user_jwt: user_jwt,
18
+ api_key: api_key,
19
+ idp_url: idp_url
10
20
  elsif secure_id.present?
11
- RegistrationClient.new secure_id: secure_id
21
+ RegistrationClient.new secure_id: secure_id,
22
+ api_key: api_key,
23
+ idp_url: idp_url
12
24
  else
13
- raise ArgumentError
25
+ AdminClient.new api_key: api_key,
26
+ idp_url: idp_url
14
27
  end
15
28
  end
29
+ # rubocop:enable Metrics/ParameterLists, Metrics/MethodLength
16
30
  end
17
31
  end
@@ -14,10 +14,10 @@ module OauthIm
14
14
  @default_idp_url ||= OauthIm.configuration.idp_url
15
15
  end
16
16
 
17
- def initialize(api_key: self.class.default_api_key,
18
- idp_url: self.class.default_idp_url)
19
- @api_key = api_key
20
- @idp_url = idp_url
17
+ def initialize(api_key: nil,
18
+ idp_url: nil)
19
+ @api_key = api_key || self.class.default_api_key
20
+ @idp_url = idp_url || self.class.default_idp_url
21
21
  end
22
22
 
23
23
  private
@@ -17,10 +17,10 @@ module OauthIm
17
17
 
18
18
  attr_reader :attrs
19
19
 
20
- def initialize(attrs)
21
- @attrs = (attrs || {}).with_indifferent_access
22
- super api_key: attrs.fetch(:api_key, self.class.default_api_key),
23
- idp_url: attrs.fetch(:idp_url, self.class.default_idp_url)
20
+ def initialize(opts)
21
+ @attrs = (opts || {}).to_h.with_indifferent_access
22
+ super api_key: @attrs[:api_key],
23
+ idp_url: @attrs[:idp_url]
24
24
  end
25
25
 
26
26
  def grant_sponsorship
@@ -5,8 +5,8 @@ module OauthIm
5
5
  attr_reader :secure_id
6
6
 
7
7
  def initialize(secure_id:,
8
- api_key: self.class.default_api_key,
9
- idp_url: self.class.default_idp_url)
8
+ api_key: nil,
9
+ idp_url: nil)
10
10
  @secure_id = secure_id
11
11
  super api_key: api_key, idp_url: idp_url
12
12
  end
@@ -13,11 +13,11 @@ module OauthIm
13
13
  end
14
14
 
15
15
  def initialize(request:,
16
- idp_url: self.class.default_idp_url,
17
- client_id: self.class.default_client_id)
16
+ client_id: nil,
17
+ idp_url: nil)
18
18
  @request = request
19
- @idp_url = idp_url
20
- @client_id = client_id
19
+ @idp_url = idp_url || self.class.default_idp_url
20
+ @client_id = client_id || self.class.default_client_id
21
21
  end
22
22
 
23
23
  def login_url
@@ -9,8 +9,8 @@ module OauthIm
9
9
  attr_reader :user_jwt
10
10
 
11
11
  def initialize(user_jwt:,
12
- api_key: self.class.default_api_key,
13
- idp_url: self.class.default_idp_url)
12
+ api_key: nil,
13
+ idp_url: nil)
14
14
  @user_jwt = user_jwt&.with_indifferent_access
15
15
  super api_key: api_key, idp_url: idp_url
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.15.0'
4
+ VERSION = '0.15.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth_im
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Connally
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-02 00:00:00.000000000 Z
11
+ date: 2024-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusionauth_client