minato-rails-auth 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minato/rails/auth/user.rb +12 -8
- data/lib/minato/rails/auth/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: 066ebdf4bb5c9974b2fb7081cb9a49b1f94cc7827bade857513537a189567eb6
|
4
|
+
data.tar.gz: 9360a913dda2ef27b36e5ef6f5608b9f3663f5a9f0fbd14efcae7ef09575298f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d218d8a28492a771b5217c053975bcedc2c2435200c31ff28012d7ce6be28a2eff526221f7c5095bea55b1056ca8b764a5dc09a7fd13aadb9ae4580f8976e53
|
7
|
+
data.tar.gz: 946d093736ee168f09a9bded1b94c5e78bd941ec5dad35d3b8e0af1150ef30d2161f2443fbc6f1f3dc1945a063d13ead5adc23a91d90ef89ba3efce8a285d257
|
@@ -13,21 +13,23 @@ module Minato
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def human?
|
16
|
-
|
16
|
+
session&.identity.present?
|
17
17
|
end
|
18
18
|
|
19
19
|
def machine?
|
20
|
-
|
20
|
+
!human?
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
return
|
23
|
+
def identity
|
24
|
+
return nil if machine?
|
25
25
|
|
26
|
-
|
26
|
+
return impersonator_identity unless impersonated?
|
27
|
+
|
28
|
+
session.identity.metadata_public.impersonated_identity
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
30
|
-
session.identity
|
31
|
+
def impersonator_identity
|
32
|
+
session.identity
|
31
33
|
end
|
32
34
|
|
33
35
|
def subject
|
@@ -35,7 +37,9 @@ module Minato
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def impersonated?
|
38
|
-
|
40
|
+
return false if machine?
|
41
|
+
|
42
|
+
session.identity.metadata_public&.impersonated_identity.present?
|
39
43
|
end
|
40
44
|
|
41
45
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minato-rails-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ferreri
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|