minato-rails-auth 0.2.0 → 0.2.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: d8604698708e566c6bafcdfb266913b0e2aacbdabb44451212cfab2af34f2583
4
- data.tar.gz: 5a08d876eee74aa03c58dea4893e2dab2d15abe9c4392440a3a6f9ccb2a4ff2d
3
+ metadata.gz: 066ebdf4bb5c9974b2fb7081cb9a49b1f94cc7827bade857513537a189567eb6
4
+ data.tar.gz: 9360a913dda2ef27b36e5ef6f5608b9f3663f5a9f0fbd14efcae7ef09575298f
5
5
  SHA512:
6
- metadata.gz: 37c6f45719975a70f7fc2ba11b2605d6764d080126281d6cf88d212c575d05f041ed8e41c29ab93045ca9b992711f4c22084795f6ddadabb4b25e4fc21b39f60
7
- data.tar.gz: e36d6abdc74a8e3ec50aace97f9840fbf5210080ed97fffc0dde44f6cf7cc1c397ad89cee7b30dbd19117683eb4739cfe8038f360b4249aca437c8345b078dad
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
- @human ||= @token_payload.respond_to?(:session)
16
+ session&.identity.present?
17
17
  end
18
18
 
19
19
  def machine?
20
- @machine ||= !human?
20
+ !human?
21
21
  end
22
22
 
23
- def identity_id
24
- return session.identity.id unless impersonated?
23
+ def identity
24
+ return nil if machine?
25
25
 
26
- session.identity.metadata_public.impersonated_identity_id
26
+ return impersonator_identity unless impersonated?
27
+
28
+ session.identity.metadata_public.impersonated_identity
27
29
  end
28
30
 
29
- def impersonator_identity_id
30
- session.identity.id
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
- !session.identity.metadata_public&.impersonated_identity_id.nil?
40
+ return false if machine?
41
+
42
+ session.identity.metadata_public&.impersonated_identity.present?
39
43
  end
40
44
 
41
45
  private
@@ -3,7 +3,7 @@
3
3
  module Minato
4
4
  module Rails
5
5
  module Auth
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.2'
7
7
  end
8
8
  end
9
9
  end
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.0
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-28 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport