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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a59e0e9162a90d33da8e0d9738c6960db2286acd49db59d85bdc4c352402205b
4
- data.tar.gz: c1255d172a2825dcc54f21f68151a64985346f2f2e3d4b236a77ff8ce40c40e4
3
+ metadata.gz: b7ec77ce68ce663fe0a00048891e79c5fa3a3c2c64d5c92350ee76dd1067cd39
4
+ data.tar.gz: 4053424aac25cbfc0d68d3bc5c22319c7313d6d22f4e19e66a44d138303e7ada
5
5
  SHA512:
6
- metadata.gz: 2df583c0be8b0df69c62c5663b7176a54b0e762b4800bdb01b6f90f8835446878fb7c45a5722f78a45a5903681e946c167f80d9d8b7cc23dfc872b7a956ec187
7
- data.tar.gz: ae453c594be804358d5dec8a3f8f0526867352b2f77346e42c1c2ccab093df22d9c3f520b70e5e680afd292ab8d316efae3004f4555e4e0ac975e09b7ee0eb5d
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::Concerns::SetUserByToken
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
@@ -4,7 +4,7 @@ require_dependency 'graphql_devise/application_controller'
4
4
 
5
5
  module GraphqlDevise
6
6
  class GraphqlController < ApplicationController
7
- include GraphqlDevise::Concerns::SetUserByToken
7
+ include GraphqlDevise::SetUserByToken
8
8
 
9
9
  def auth
10
10
  result = if params[:_json]
@@ -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::Concerns::Model',
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::Concerns::SetUserByToken',
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::Concerns::Model'
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::Concerns::SetUserByToken'
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::Concerns::SetUserByToken
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))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlDevise
4
- VERSION = '0.18.0'.freeze
4
+ VERSION = '0.18.1'.freeze
5
5
  end
@@ -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'
@@ -3,7 +3,7 @@
3
3
  module Api
4
4
  module V1
5
5
  class GraphqlController < ApplicationController
6
- include GraphqlDevise::Concerns::SetUserByToken
6
+ include GraphqlDevise::SetUserByToken
7
7
 
8
8
  def graphql
9
9
  result = DummySchema.execute(params[:query], **execute_params(params))
@@ -7,5 +7,5 @@ class Admin < ApplicationRecord
7
7
  :validatable,
8
8
  :confirmable
9
9
 
10
- include GraphqlDevise::Concerns::Model
10
+ include GraphqlDevise::Authenticatable
11
11
  end
@@ -6,5 +6,5 @@ class Guest < ApplicationRecord
6
6
  :recoverable,
7
7
  :validatable
8
8
 
9
- include GraphqlDevise::Concerns::Model
9
+ include GraphqlDevise::Authenticatable
10
10
  end
@@ -7,7 +7,7 @@ class SchemaUser < ApplicationRecord
7
7
  :validatable,
8
8
  :confirmable
9
9
 
10
- include GraphqlDevise::Concerns::Model
10
+ include GraphqlDevise::Authenticatable
11
11
 
12
12
  validates :name, presence: true
13
13
  end
@@ -10,7 +10,7 @@ class User < ApplicationRecord
10
10
  :validatable,
11
11
  :confirmable
12
12
 
13
- include GraphqlDevise::Concerns::Model
13
+ include GraphqlDevise::Authenticatable
14
14
 
15
15
  validates :name, presence: true
16
16
 
@@ -4,7 +4,7 @@ module Users
4
4
  class Customer < ApplicationRecord
5
5
  devise :database_authenticatable, :validatable
6
6
 
7
- include GraphqlDevise::Concerns::Model
7
+ include GraphqlDevise::Authenticatable
8
8
 
9
9
  validates :name, presence: true
10
10
  end
@@ -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::Concerns::Model/m
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::Concerns::SetUserByToken/
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::Concerns::Model/m
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::Concerns::SetUserByToken/
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::Concerns::Model/m
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::Concerns::SetUserByToken/
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.0
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-02-08 00:00:00.000000000 Z
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