graphql_devise 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/graphql_devise/concerns/additional_controller_methods.rb +1 -1
- data/app/controllers/graphql_devise/concerns/set_user_by_token.rb +7 -0
- data/app/controllers/graphql_devise/graphql_controller.rb +1 -1
- data/app/models/graphql_devise/concerns/model.rb +7 -0
- data/lib/generators/graphql_devise/install_generator.rb +4 -4
- data/lib/graphql_devise/concerns/authenticatable.rb +14 -0
- data/lib/graphql_devise/concerns/set_user_by_token.rb +12 -0
- data/lib/graphql_devise/schema_plugin.rb +1 -1
- data/lib/graphql_devise/version.rb +1 -1
- data/lib/graphql_devise.rb +4 -0
- data/spec/dummy/app/controllers/api/v1/graphql_controller.rb +1 -1
- data/spec/dummy/app/models/admin.rb +1 -1
- data/spec/dummy/app/models/guest.rb +1 -1
- data/spec/dummy/app/models/schema_user.rb +1 -1
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/app/models/users/customer.rb +1 -1
- data/spec/generators/graphql_devise/install_generator_spec.rb +6 -6
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ec77ce68ce663fe0a00048891e79c5fa3a3c2c64d5c92350ee76dd1067cd39
|
4
|
+
data.tar.gz: 4053424aac25cbfc0d68d3bc5c22319c7313d6d22f4e19e66a44d138303e7ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6164f799f2ae729a4b5c138d96e39c02ad21efd5aeb7a241179fdafbd71e414d34a9aaa36c2e261945d2c32208d9087b0585978adcac01aebba4a7adbd6b89a
|
7
|
+
data.tar.gz: e1e130fecbe7adc8dc2c7a55b27f83c32cab04b273fc949a00a6dca3d4e9a1b6a456549ef73eb2235115de01a8c0cb6e09aa4fc9c7ddf61feaba32f04409c5c4
|
@@ -46,7 +46,7 @@ module GraphqlDevise
|
|
46
46
|
Use `gql_devise_context(model)` instead.
|
47
47
|
|
48
48
|
EXAMPLE
|
49
|
-
include GraphqlDevise::
|
49
|
+
include GraphqlDevise::SetUserByToken
|
50
50
|
|
51
51
|
DummySchema.execute(params[:query], context: gql_devise_context(User))
|
52
52
|
DummySchema.execute(params[:query], context: gql_devise_context(User, Admin))
|
@@ -8,6 +8,13 @@ module GraphqlDevise
|
|
8
8
|
included do
|
9
9
|
include DeviseTokenAuth::Concerns::SetUserByToken
|
10
10
|
include GraphqlDevise::Concerns::AdditionalControllerMethods
|
11
|
+
|
12
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc, caller)
|
13
|
+
Including GraphqlDevise::Concerns::SetUserByToken is deprecated and will be removed in a future version of
|
14
|
+
this gem. Please use GraphqlDevise::SetUserByToken instead.
|
15
|
+
EXAMPLE
|
16
|
+
include GraphqlDevise::SetUserByToken
|
17
|
+
DEPRECATION
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
@@ -12,6 +12,13 @@ module GraphqlDevise
|
|
12
12
|
include GraphqlDevise::Concerns::AdditionalModelMethods
|
13
13
|
|
14
14
|
GraphqlDevise.configure_warden_serializer_for_model(self)
|
15
|
+
|
16
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc, caller)
|
17
|
+
Including GraphqlDevise::Concerns::Model is deprecated and will be removed in a future version of
|
18
|
+
this gem. Please use GraphqlDevise::Authenticatable instead.
|
19
|
+
EXAMPLE
|
20
|
+
include GraphqlDevise::Authenticatable
|
21
|
+
DEPRECATION
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
@@ -18,13 +18,13 @@ module GraphqlDevise
|
|
18
18
|
if File.exist?(File.expand_path("app/models/#{user_class.underscore}.rb", destination_root))
|
19
19
|
gsub_file(
|
20
20
|
"app/models/#{user_class.underscore}.rb",
|
21
|
-
'GraphqlDevise::
|
21
|
+
'GraphqlDevise::Authenticatable',
|
22
22
|
'DeviseTokenAuth::Concerns::User'
|
23
23
|
)
|
24
24
|
end
|
25
25
|
gsub_file(
|
26
26
|
'app/controllers/application_controller.rb',
|
27
|
-
'GraphqlDevise::
|
27
|
+
'GraphqlDevise::SetUserByToken',
|
28
28
|
'DeviseTokenAuth::Concerns::SetUserByToken'
|
29
29
|
)
|
30
30
|
|
@@ -54,7 +54,7 @@ module GraphqlDevise
|
|
54
54
|
gsub_file(
|
55
55
|
"app/models/#{user_class.underscore}.rb",
|
56
56
|
/^\s+include DeviseTokenAuth::Concerns::User/,
|
57
|
-
' include GraphqlDevise::
|
57
|
+
' include GraphqlDevise::Authenticatable'
|
58
58
|
)
|
59
59
|
end
|
60
60
|
|
@@ -62,7 +62,7 @@ module GraphqlDevise
|
|
62
62
|
gsub_file(
|
63
63
|
'app/controllers/application_controller.rb',
|
64
64
|
/^\s+include DeviseTokenAuth::Concerns::SetUserByToken/,
|
65
|
-
' include GraphqlDevise::
|
65
|
+
' include GraphqlDevise::SetUserByToken'
|
66
66
|
)
|
67
67
|
end
|
68
68
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphqlDevise
|
4
|
+
module Authenticatable
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
include DeviseTokenAuth::Concerns::User
|
9
|
+
include GraphqlDevise::Concerns::AdditionalModelMethods
|
10
|
+
|
11
|
+
::GraphqlDevise.configure_warden_serializer_for_model(self)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphqlDevise
|
4
|
+
module SetUserByToken
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
include DeviseTokenAuth::Concerns::SetUserByToken
|
9
|
+
include GraphqlDevise::Concerns::AdditionalControllerMethods
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -37,7 +37,7 @@ module GraphqlDevise
|
|
37
37
|
Please use `gql_devise_context` in you controller instead.
|
38
38
|
|
39
39
|
EXAMPLE
|
40
|
-
include GraphqlDevise::
|
40
|
+
include GraphqlDevise::SetUserByToken
|
41
41
|
|
42
42
|
DummySchema.execute(params[:query], context: gql_devise_context(User))
|
43
43
|
DummySchema.execute(params[:query], context: gql_devise_context(User, Admin))
|
data/lib/graphql_devise.rb
CHANGED
@@ -60,6 +60,10 @@ require 'graphql_devise/errors/user_error'
|
|
60
60
|
require 'graphql_devise/errors/authentication_error'
|
61
61
|
require 'graphql_devise/errors/detailed_user_error'
|
62
62
|
|
63
|
+
# TODO: Remove when merged into master
|
64
|
+
require 'graphql_devise/concerns/authenticatable'
|
65
|
+
require 'graphql_devise/concerns/set_user_by_token.rb'
|
66
|
+
|
63
67
|
require 'graphql_devise/concerns/controller_methods'
|
64
68
|
require 'graphql_devise/schema'
|
65
69
|
require 'graphql_devise/types/authenticatable_type'
|
@@ -29,9 +29,9 @@ RSpec.describe GraphqlDevise::InstallGenerator, type: :generator do
|
|
29
29
|
|
30
30
|
assert_migration 'db/migrate/devise_token_auth_create_admins.rb'
|
31
31
|
|
32
|
-
assert_file 'app/models/admin.rb', /^\s{2}devise :.+include GraphqlDevise::
|
32
|
+
assert_file 'app/models/admin.rb', /^\s{2}devise :.+include GraphqlDevise::Authenticatable/m
|
33
33
|
|
34
|
-
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::
|
34
|
+
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::SetUserByToken/
|
35
35
|
|
36
36
|
assert_file 'app/graphql/gqld_dummy_schema.rb', /\s+#{Regexp.escape("GraphqlDevise::ResourceLoader.new(Admin)")}/
|
37
37
|
end
|
@@ -50,9 +50,9 @@ RSpec.describe GraphqlDevise::InstallGenerator, type: :generator do
|
|
50
50
|
|
51
51
|
assert_migration 'db/migrate/devise_token_auth_create_users.rb'
|
52
52
|
|
53
|
-
assert_file 'app/models/user.rb', /^\s{2}devise :.+include GraphqlDevise::
|
53
|
+
assert_file 'app/models/user.rb', /^\s{2}devise :.+include GraphqlDevise::Authenticatable/m
|
54
54
|
|
55
|
-
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::
|
55
|
+
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::SetUserByToken/
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -69,9 +69,9 @@ RSpec.describe GraphqlDevise::InstallGenerator, type: :generator do
|
|
69
69
|
|
70
70
|
assert_migration 'db/migrate/devise_token_auth_create_admins.rb'
|
71
71
|
|
72
|
-
assert_file 'app/models/admin.rb', /^\s{2}devise :.+include GraphqlDevise::
|
72
|
+
assert_file 'app/models/admin.rb', /^\s{2}devise :.+include GraphqlDevise::Authenticatable/m
|
73
73
|
|
74
|
-
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::
|
74
|
+
assert_file 'app/controllers/application_controller.rb', /^\s{2}include GraphqlDevise::SetUserByToken/
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Celi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise_token_auth
|
@@ -308,7 +308,9 @@ files:
|
|
308
308
|
- graphql_devise.gemspec
|
309
309
|
- lib/generators/graphql_devise/install_generator.rb
|
310
310
|
- lib/graphql_devise.rb
|
311
|
+
- lib/graphql_devise/concerns/authenticatable.rb
|
311
312
|
- lib/graphql_devise/concerns/controller_methods.rb
|
313
|
+
- lib/graphql_devise/concerns/set_user_by_token.rb
|
312
314
|
- lib/graphql_devise/default_operations/mutations.rb
|
313
315
|
- lib/graphql_devise/default_operations/resolvers.rb
|
314
316
|
- lib/graphql_devise/engine.rb
|