minato-rails-auth 0.3.2 → 0.3.4

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: 44af2213c58fe77a813ac75a01896ccd918b777152bff475896110b495254a81
4
- data.tar.gz: eaf8e02b7b539da7ff68bc8ef8bd939d10d04b665e90928da89b699ae0119cb9
3
+ metadata.gz: bdda1705a7cd83e0dae0ffa26adfa16d4e6f3a5ebab4fe18baf91cb8b3f7c095
4
+ data.tar.gz: 2d9c2aec0efb3dcb2af02b94f69ea30676592baeb9b5c77589f61e07fe609b5d
5
5
  SHA512:
6
- metadata.gz: 11f5e8b9b574a931feb8c50fdaed19d2a8cf4408c546bf29477dd877b5985e0c878bd993ffd5eb9a252267a1374bcd4d21f04f424f401b5c7bbc74df785af4ce
7
- data.tar.gz: aa9e9c5eee92e58fac2f4e5ecda646cf0600347dd96607aa55188570895522eb1e4be140bf9649a0ad0b1f635ce178360a7fbaa17833c6df374fae17e50e6280
6
+ metadata.gz: b3820c9fc66a8f13341521eb88e6fb574209531a73a17d45bef2cee24ba13c475290574bb7534d801041d5d4a97b68be2759894cacd3c544b2b69f86a0822789
7
+ data.tar.gz: 590c5291d96fdf1952c3cfffb00fdb4e862ece9653f05827b455467f4bd6869650e6704681bebdcc5546a527bbddf3e0a57dbfea3a8ccd271b7df4bd69e87932
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.2.2
data/README.md CHANGED
@@ -122,7 +122,7 @@ And now it will be available the following shared contexts, that you can use fol
122
122
  - `with jwt authentication`:
123
123
  - Just create a jwt with empty payload. To set the payload you should create a `jwt_payload` variable using `let`.
124
124
  - `with human jwt authentication`:
125
- - Creates a jwt with human payload. You set the user attributes with variables `jwt_email`, `jwt_account_id`, `jwt_session_id`, `jwt_identity_id` and `jwt_payload`.
125
+ - Creates a jwt with human payload. You set the user attributes with variables `jwt_email`, `jwt_session_id`, `jwt_identity_id` and `jwt_payload`.
126
126
  - `with machine jwt authentication`:
127
127
  - Creates a jwt with machine payload. You can set the machine name with the variable `jwt_machine`.
128
128
  - `with missing jwt authentication`:
data/compose.yml CHANGED
@@ -4,6 +4,7 @@ services:
4
4
  GITLAB_AUTH_TOKEN: ${GITLAB_AUTH_TOKEN}
5
5
  image: us-east1-docker.pkg.dev/minato-cloud/images/ruby-minato:1.0.0-dev
6
6
  working_dir: /usr/src/api
7
+ command: /bin/sh -c "while sleep 1000; do :; done"
7
8
  volumes:
8
9
  - .:/usr/src/api:z
9
10
  - bundle:/usr/local/bundle
@@ -17,7 +17,6 @@ module Minato
17
17
 
18
18
  RSpec.shared_context 'with human jwt authentication', shared_context: :metadata do
19
19
  let(:jwt_email) { 'test@email.com' }
20
- let(:jwt_account_id) { '555' }
21
20
  let(:jwt_session_id) { '67cf621f-4f49-4ca5-9365-62520849170b' }
22
21
  let(:jwt_identity_id) { 'adb1e688-17c0-4241-bc24-912fa6b5f6c3' }
23
22
  let(:jwt_authentication_method) { 'password' }
@@ -37,12 +36,9 @@ module Minato
37
36
  'expires_at' => '2021-09-29T20:15:44.731576Z',
38
37
  'authentication_methods' => jwt_authentication_methods,
39
38
  'identity' => {
40
- 'id' => jwt_identity_id,
41
- 'traits' => {
39
+ 'id' => jwt_identity_id,
40
+ 'traits' => {
42
41
  'email' => jwt_email
43
- },
44
- 'metadata_public' => {
45
- 'account_id' => jwt_account_id
46
42
  }
47
43
  }
48
44
  }
@@ -22,11 +22,11 @@ module Minato
22
22
  end
23
23
 
24
24
  def auth_sso?
25
- authentication_method? 'oidc'
25
+ authentication_method?('oidc')
26
26
  end
27
27
 
28
28
  def auth_password?
29
- authentication_method? 'password'
29
+ authentication_method?('password')
30
30
  end
31
31
 
32
32
  def auth_provider
@@ -35,14 +35,6 @@ module Minato
35
35
  authentication_method('oidc')['provider']
36
36
  end
37
37
 
38
- def collaborator?
39
- human? && auth_provider == 'grupoangelus'
40
- end
41
-
42
- def customer?
43
- !collaborator?
44
- end
45
-
46
38
  def identity
47
39
  return nil if machine?
48
40
 
@@ -52,6 +44,8 @@ module Minato
52
44
  end
53
45
 
54
46
  def impersonator_identity
47
+ return nil if session_obj.blank?
48
+
55
49
  session_obj.identity
56
50
  end
57
51
 
@@ -76,6 +70,8 @@ module Minato
76
70
  end
77
71
 
78
72
  def authentication_method(auth_method)
73
+ return if session_raw.blank?
74
+
79
75
  session_raw['authentication_methods']&.find { |m| m['method'].to_s == auth_method.to_s }
80
76
  end
81
77
 
@@ -3,7 +3,7 @@
3
3
  module Minato
4
4
  module Rails
5
5
  module Auth
6
- VERSION = '0.3.2'
6
+ VERSION = '0.3.4'
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.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ferreri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-26 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -49,6 +49,7 @@ files:
49
49
  - ".devcontainer/docker-compose.yml"
50
50
  - ".rspec"
51
51
  - ".rubocop.yml"
52
+ - ".ruby-version"
52
53
  - README.md
53
54
  - Rakefile
54
55
  - compose.yml