oauth_im 0.14.0 → 0.15.0

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: cbc27c0f6156c8c268aa642b7bb93ec558df3242ba4935bf6108d25b943e22a7
4
- data.tar.gz: bd9bcc76ee46fef4b1d592bf6ad1f27d847aac830195e82d13c878009858fb0c
3
+ metadata.gz: 96a52f6e8d59737439a315eb6b64a883dc8c8a8680d4b1a136b98fdd042eb4f7
4
+ data.tar.gz: 04cbae317291c2a9f16b20f41bd8e394ef52ebbfbdd132eb474b768110de9bca
5
5
  SHA512:
6
- metadata.gz: b00319d1bf052c6bcfbceac00337ee736d029f797be234dbe96e90c0d02a266dff7382a7075779947aec7b5f3dd448fbd366b84baff2ffa41b8803885cdc32fe
7
- data.tar.gz: eb03efb12c05c9f5785ce4cb5d852a940f082c269decc536ffe2bcb98698931a742c885f92db1b666c0bed51d88d5c214a3f9295dab76f537aced0cd0b965de4
6
+ metadata.gz: 125503e2251bcab4b98933f45f8533798cc8ebb808207c3df9ffaeba40b3640db8888638b2a319b9edf3f0a71a4f281600ffbf0c899d380ed42f70c754a5b1f9
7
+ data.tar.gz: aa3935aa8ec9b3a974931813a15f484d52e24204ba8bf71a70d042152e003a66ec1b5d5e427842b8c7901ff1d53866460950607f823a78eb77108c323a60c64c
@@ -4,10 +4,23 @@ require 'fusionauth/fusionauth_client'
4
4
 
5
5
  module OauthIm
6
6
  class IdpClient
7
- private
7
+ attr_reader :api_key, :idp_url
8
+
9
+ def self.default_api_key
10
+ @default_api_key ||= OauthIm.configuration.api_key
11
+ end
12
+
13
+ def self.default_idp_url
14
+ @default_idp_url ||= OauthIm.configuration.idp_url
15
+ end
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
21
+ end
8
22
 
9
- delegate :configuration, to: OauthIm
10
- delegate :api_key, :idp_url, to: :configuration
23
+ private
11
24
 
12
25
  def client
13
26
  @client ||= ::FusionAuth::FusionAuthClient.new api_key, idp_url
@@ -18,8 +18,9 @@ module OauthIm
18
18
  attr_reader :attrs
19
19
 
20
20
  def initialize(attrs)
21
- @attrs = attrs
22
- super()
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)
23
24
  end
24
25
 
25
26
  def grant_sponsorship
@@ -4,9 +4,11 @@ module OauthIm
4
4
  class RegistrationClient < IdpClient
5
5
  attr_reader :secure_id
6
6
 
7
- def initialize(secure_id:)
7
+ def initialize(secure_id:,
8
+ api_key: self.class.default_api_key,
9
+ idp_url: self.class.default_idp_url)
8
10
  @secure_id = secure_id
9
- super()
11
+ super api_key: api_key, idp_url: idp_url
10
12
  end
11
13
 
12
14
  def register(submission_params:)
@@ -2,10 +2,22 @@
2
2
 
3
3
  module OauthIm
4
4
  class RequestClient
5
- attr_reader :request
5
+ attr_reader :request, :idp_url, :client_id
6
6
 
7
- def initialize(request:)
8
- @request = request
7
+ def self.default_idp_url
8
+ @default_idp_url ||= OauthIm.configuration.idp_url
9
+ end
10
+
11
+ def self.default_client_id
12
+ @default_client_id ||= OauthIm.configuration.client_id
13
+ end
14
+
15
+ def initialize(request:,
16
+ idp_url: self.class.default_idp_url,
17
+ client_id: self.class.default_client_id)
18
+ @request = request
19
+ @idp_url = idp_url
20
+ @client_id = client_id
9
21
  end
10
22
 
11
23
  def login_url
@@ -24,7 +36,7 @@ module OauthIm
24
36
 
25
37
  delegate :host_with_port, :params, to: :request
26
38
  delegate :configuration, to: OauthIm
27
- delegate :authorize_url, :token_url, :idp_url, :client_id, :client_secret,
39
+ delegate :authorize_url, :token_url, :client_secret,
28
40
  to: :configuration
29
41
  delegate :auth_code, to: :oauth_client
30
42
 
@@ -8,9 +8,11 @@ module OauthIm
8
8
 
9
9
  attr_reader :user_jwt
10
10
 
11
- def initialize(user_jwt:)
11
+ def initialize(user_jwt:,
12
+ api_key: self.class.default_api_key,
13
+ idp_url: self.class.default_idp_url)
12
14
  @user_jwt = user_jwt&.with_indifferent_access
13
- super()
15
+ super api_key: api_key, idp_url: idp_url
14
16
  end
15
17
 
16
18
  def email
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.14.0'
4
+ VERSION = '0.15.0'
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.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Connally
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2024-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusionauth_client
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.32.1
19
+ version: 1.42.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.32.1
26
+ version: 1.42.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement