ibrain-auth 0.2.0 → 0.2.3

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: c55531d53a9d3ae38c32c05a522325c7998788d2c1afa99be87fd152fb87c500
4
- data.tar.gz: 52bc3f40ffab1748a6597219b6f7c752e6a984c427c6f969376876e600e55f7b
3
+ metadata.gz: d92db7ce276ebc1d2452aa711b72a0c655a339bfabced5c67f864f1a65eaba0d
4
+ data.tar.gz: 7b8691f0dd5e97027d2b65914e4350bbb9ebf226f255d40c657f1697df16aa60
5
5
  SHA512:
6
- metadata.gz: 79df30aa4fcffcb37dd98e2f61e38b0ee638d902d8fab4a4024d56491a8011e7314b4bc0b62c8ff602313cfd8c8d1d50856a86f780f4b5b88ced20917880f586
7
- data.tar.gz: 18aa083ae454684f47c6ce420bc58a34e9c028f1177a699ee277c2a28a12d83281ad01221d7e8aa6da44cc29aff8bb0b05c671d3164a8292f11c92229bdee560
6
+ metadata.gz: 68cd07f1bc0c0541388bdfa5da98b50368ec129cbc2941b0b73fcecd04424d107d676548143b0f1303dcd9f64296bfa2bf0f5a1adb5259a0285036f79d6b6ea1
7
+ data.tar.gz: 12c8c892bbd2bb9673aa8b3a98204c624e3c00b673627d72f438697ec4887c8e49642ad66fd8fc4fcc5e9cc79435a6b2b4b9c6d8f7dee343008bc51c110b2d11
@@ -6,8 +6,7 @@ module Ibrain::Auth::Mutations
6
6
  field :token, String, null: true
7
7
  field :result, Boolean, null: true
8
8
 
9
- argument :username, String, description: 'Username', required: true
10
- argument :password, String, description: 'Password', required: true
9
+ argument :auth, Ibrain::Auth::Config.sign_in_input, required: true
11
10
  argument :device_token, String, description: 'Device token for notification', required: false
12
11
 
13
12
  def resolve(args)
@@ -44,7 +43,9 @@ module Ibrain::Auth::Mutations
44
43
  private
45
44
 
46
45
  def normalize_params(args)
47
- ActionController::Parameters.new({ auth: args })
46
+ args[:auth].to_params
47
+ rescue StandardError
48
+ ActionController::Parameters.new({})
48
49
  end
49
50
 
50
51
  def auth_options
@@ -44,7 +44,9 @@ module Ibrain::Auth::Mutations
44
44
  private
45
45
 
46
46
  def normalize_params(args)
47
- ActionController::Parameters.new({ auth: args })
47
+ args[:user].to_params
48
+ rescue StandardError
49
+ ActionController::Parameters.new({})
48
50
  end
49
51
 
50
52
  def auth_options
@@ -45,7 +45,9 @@ module Ibrain::Auth::Mutations
45
45
  private
46
46
 
47
47
  def normalize_params(args)
48
- ActionController::Parameters.new({ auth: args })
48
+ ActionController::Parameters.new(args.as_json)
49
+ rescue StandardError
50
+ ActionController::Parameters.new({})
49
51
  end
50
52
 
51
53
  def auth_options
@@ -45,7 +45,9 @@ module Ibrain::Auth::Mutations
45
45
  private
46
46
 
47
47
  def normalize_params(args)
48
- ActionController::Parameters.new({ auth: args })
48
+ ActionController::Parameters.new(args.as_json)
49
+ rescue StandardError
50
+ ActionController::Parameters.new({})
49
51
  end
50
52
 
51
53
  def auth_options
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ibrain
4
+ module Auth
5
+ module Types
6
+ module Input
7
+ class SignInInput < Ibrain::Types::BaseInputObject
8
+ argument :username, String, required: true
9
+ argument :password, String, required: true
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -3,7 +3,7 @@
3
3
  module Ibrain
4
4
  module Auth
5
5
  module Types
6
- module Attributes
6
+ module Input
7
7
  class SignUpInput < Ibrain::Types::BaseInputObject
8
8
  argument :first_name, String, required: false
9
9
  argument :last_name, String, required: false
@@ -50,11 +50,11 @@ class AuthRepository < Ibrain::BaseRepository
50
50
  end
51
51
 
52
52
  def normalize_params
53
- params.require(:auth).permit(permitted_attributes)
53
+ params.permit(permitted_attributes)
54
54
  end
55
55
 
56
56
  def manual_params
57
- params.require(:auth).permit(:username, :password)
57
+ params.permit(:username, :password)
58
58
  end
59
59
 
60
60
  def sso_verify
@@ -84,7 +84,7 @@ class AuthRepository < Ibrain::BaseRepository
84
84
  reset_password_token reset_password_sent_at
85
85
  remember_created_at sign_in_count uid jti
86
86
  current_sign_in_at last_sign_in_at current_sign_in_ip
87
- last_sign_in_ip role encrypted_password
87
+ last_sign_in_ip role encrypted_password id_token
88
88
  ]
89
89
  end
90
90
  end
@@ -12,5 +12,8 @@ Ibrain::Auth.config do |config|
12
12
  config.user_table_name = 'ibrain_users'
13
13
 
14
14
  # sign_up graphql input
15
- config.sign_up_input = Ibrain::Auth::Types::Attributes::SignUpInput
15
+ config.sign_up_input = Ibrain::Auth::Types::Input::SignUpInput
16
+
17
+ # sign_in graphql input
18
+ config.sign_up_input = Ibrain::Auth::Types::Input::SignInInput
16
19
  end
@@ -4,14 +4,14 @@ module Ibrain
4
4
  # frozen_string_literal: true
5
5
 
6
6
  module Auth
7
- VERSION = '0.2.0'
7
+ VERSION = '0.2.3'
8
8
 
9
9
  def self.ibrain_auth_version
10
10
  VERSION
11
11
  end
12
12
 
13
13
  def self.previous_ibrain_auth_minor_version
14
- '0.1.9'
14
+ '0.2.2'
15
15
  end
16
16
 
17
17
  def self.ibrain_auth_gem_version
@@ -13,6 +13,9 @@ module Ibrain
13
13
  preference :user_table_name, :string, default: 'ibrain_users'
14
14
 
15
15
  # sign_up input
16
- preference :sign_up_input, :class, default: Ibrain::Auth::Types::Attributes::SignUpInput
16
+ preference :sign_up_input, :class, default: Ibrain::Auth::Types::Input::SignUpInput
17
+
18
+ # sign_in input
19
+ preference :sign_in_input, :class, default: Ibrain::Auth::Types::Input::SignInInput
17
20
  end
18
21
  end
metadata CHANGED
@@ -1,119 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibrain-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tai Nguyen Van
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.8.0
19
+ version: '0'
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: 4.8.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: devise-encryptable
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.0
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: devise-i18n
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.10.1
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.10.1
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: devise-jwt
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.0
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.0
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ibrain-core
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.0
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.3.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 6.1.4
90
87
  - - ">="
91
88
  - !ruby/object:Gem::Version
92
- version: 6.1.4.1
89
+ version: '0'
93
90
  type: :runtime
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
96
93
  requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: 6.1.4
100
94
  - - ">="
101
95
  - !ruby/object:Gem::Version
102
- version: 6.1.4.1
96
+ version: '0'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: omniauth
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
- - - "~>"
101
+ - - ">="
108
102
  - !ruby/object:Gem::Version
109
- version: 2.0.4
103
+ version: '0'
110
104
  type: :runtime
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - "~>"
108
+ - - ">="
115
109
  - !ruby/object:Gem::Version
116
- version: 2.0.4
110
+ version: '0'
117
111
  description: Its Auth is an sso authen gem for Ruby on Rails.
118
112
  email:
119
113
  - john@techfox.io
@@ -135,7 +129,8 @@ files:
135
129
  - app/graphql/ibrain/auth/mutations/sign_up_mutation.rb
136
130
  - app/graphql/ibrain/auth/mutations/sso_sign_in_mutation.rb
137
131
  - app/graphql/ibrain/auth/mutations/sso_sign_up_mutation.rb
138
- - app/graphql/ibrain/auth/types/attributes/sign_up_input.rb
132
+ - app/graphql/ibrain/auth/types/input/sign_in_input.rb
133
+ - app/graphql/ibrain/auth/types/input/sign_up_input.rb
139
134
  - app/models/ibrain/auth/user.rb
140
135
  - app/repositories/auth_repository.rb
141
136
  - config/initializers/devise.rb
@@ -178,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
173
  - !ruby/object:Gem::Version
179
174
  version: '0'
180
175
  requirements: []
181
- rubygems_version: 3.0.9
176
+ rubygems_version: 3.3.7
182
177
  signing_key:
183
178
  specification_version: 4
184
179
  summary: Its Auth is an sso authen gem for Ruby on Rails.