oauth_im 0.14.1 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/oauth_im/client.rb +19 -5
- data/app/services/oauth_im/idp_client.rb +16 -3
- data/app/services/oauth_im/proxy_user.rb +3 -2
- data/app/services/oauth_im/registration_client.rb +4 -2
- data/app/services/oauth_im/request_client.rb +16 -4
- data/app/services/oauth_im/user_client.rb +4 -2
- data/lib/oauth_im/version.rb +1 -1
- 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: 43d9ae7d853f98f0cafe43420959218c2a85cf7b87a76c719db8ec6dba3fc274
|
4
|
+
data.tar.gz: e997dc7ee11af0976eb451c8b025286b2b988e7d4a749fd4668b5e481a00a2ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb676b5995e44372dec671b97bf903a7c68b4e082eb76763161b6f6cdea533daca7502689701f5255b23f835325ef40a6f14e21fa8bd99976cb7c95a1edba69c
|
7
|
+
data.tar.gz: 517966a4743b43427647e09c58039b8dfd53bdbaebd992cdc06181146b242f28083067c08979b11509b59b8e1bc5d09234edd3b97a6372f405570596914ece85
|
@@ -2,16 +2,30 @@
|
|
2
2
|
|
3
3
|
module OauthIm
|
4
4
|
class Client
|
5
|
-
|
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
|
-
|
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
|
@@ -4,10 +4,23 @@ require 'fusionauth/fusionauth_client'
|
|
4
4
|
|
5
5
|
module OauthIm
|
6
6
|
class IdpClient
|
7
|
-
|
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: 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
|
+
end
|
8
22
|
|
9
|
-
|
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
|
@@ -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: nil,
|
9
|
+
idp_url: nil)
|
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
|
8
|
-
@
|
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
|
+
client_id: nil,
|
17
|
+
idp_url: nil)
|
18
|
+
@request = request
|
19
|
+
@idp_url = idp_url || self.class.default_idp_url
|
20
|
+
@client_id = client_id || self.class.default_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, :
|
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: nil,
|
13
|
+
idp_url: nil)
|
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
|
data/lib/oauth_im/version.rb
CHANGED
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.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Connally
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fusionauth_client
|