graphql_devise 0.13.4 → 0.14.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 +4 -4
- data/.coveralls.yml +1 -0
- data/.gitlab-ci.yml +109 -0
- data/Appraisals +39 -5
- data/CHANGELOG.md +47 -0
- data/README.md +20 -9
- data/app/views/graphql_devise/mailer/reset_password_instructions.html.erb +7 -1
- data/config/locales/en.yml +2 -1
- data/docs/usage/reset_password_flow.md +90 -0
- data/graphql_devise.gemspec +1 -1
- data/lib/graphql_devise/concerns/controller_methods.rb +7 -1
- data/lib/graphql_devise/default_operations/mutations.rb +10 -6
- data/lib/graphql_devise/mutations/resend_confirmation.rb +2 -0
- data/lib/graphql_devise/mutations/send_password_reset.rb +2 -0
- data/lib/graphql_devise/mutations/send_password_reset_with_token.rb +37 -0
- data/lib/graphql_devise/mutations/sign_up.rb +1 -3
- data/lib/graphql_devise/mutations/update_password_with_token.rb +38 -0
- data/lib/graphql_devise/resolvers/check_password_token.rb +1 -0
- data/lib/graphql_devise/resolvers/confirm_account.rb +2 -0
- data/lib/graphql_devise/schema_plugin.rb +22 -11
- data/lib/graphql_devise/version.rb +1 -1
- data/spec/dummy/app/graphql/dummy_schema.rb +4 -3
- data/spec/dummy/app/graphql/mutations/reset_admin_password_with_token.rb +13 -0
- data/spec/dummy/config/initializers/devise_token_auth.rb +2 -0
- data/spec/dummy/config/routes.rb +2 -1
- data/spec/graphql/user_queries_spec.rb +118 -0
- data/spec/requests/mutations/additional_mutations_spec.rb +0 -1
- data/spec/requests/mutations/resend_confirmation_spec.rb +16 -1
- data/spec/requests/mutations/send_password_reset_spec.rb +16 -1
- data/spec/requests/mutations/send_password_reset_with_token_spec.rb +78 -0
- data/spec/requests/mutations/sign_up_spec.rb +19 -1
- data/spec/requests/mutations/update_password_with_token_spec.rb +119 -0
- data/spec/requests/queries/check_password_token_spec.rb +16 -1
- data/spec/requests/queries/confirm_account_spec.rb +17 -2
- data/spec/requests/queries/introspection_query_spec.rb +149 -0
- data/spec/requests/user_controller_spec.rb +9 -9
- data/spec/support/contexts/schema_test.rb +14 -0
- metadata +25 -9
- data/.travis.yml +0 -79
@@ -31,15 +31,6 @@ RSpec.describe "Integrations with the user's controller" do
|
|
31
31
|
expect(json_response[:data][:publicField]).to eq('Field does not require authentication')
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
context 'when using the failing route' do
|
36
|
-
it 'raises an invalid resource_name error' do
|
37
|
-
expect { post_request('/api/v1/failing') }.to raise_error(
|
38
|
-
GraphqlDevise::Error,
|
39
|
-
'Invalid resource_name `fail` provided to `graphql_context`. Possible values are: [:user, :admin, :guest, :users_customer, :schema_user].'
|
40
|
-
)
|
41
|
-
end
|
42
|
-
end
|
43
34
|
end
|
44
35
|
|
45
36
|
describe 'privateField' do
|
@@ -77,6 +68,15 @@ RSpec.describe "Integrations with the user's controller" do
|
|
77
68
|
)
|
78
69
|
end
|
79
70
|
end
|
71
|
+
|
72
|
+
context 'when using the failing route' do
|
73
|
+
it 'raises an invalid resource_name error' do
|
74
|
+
expect { post_request('/api/v1/failing') }.to raise_error(
|
75
|
+
GraphqlDevise::Error,
|
76
|
+
'Invalid resource_name `fail` provided to `graphql_context`. Possible values are: [:user, :admin, :guest, :users_customer, :schema_user].'
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
80
80
|
end
|
81
81
|
|
82
82
|
context 'when using an interpreter schema' do
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.shared_context 'with graphql schema test' do
|
4
|
+
let(:variables) { {} }
|
5
|
+
let(:resource_names) { [:user] }
|
6
|
+
let(:resource) { nil }
|
7
|
+
let(:controller) { instance_double(GraphqlDevise::GraphqlController) }
|
8
|
+
let(:context) do
|
9
|
+
{ current_resource: resource, controller: controller, resource_name: resource_names }
|
10
|
+
end
|
11
|
+
let(:response) do
|
12
|
+
schema.execute(query, context: context, variables: variables).deep_symbolize_keys
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Celi
|
8
8
|
- David Revelo
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise_token_auth
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: '1.8'
|
41
41
|
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
43
|
+
version: 1.13.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: '1.8'
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.13.0
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: rails
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,13 +275,14 @@ executables: []
|
|
275
275
|
extensions: []
|
276
276
|
extra_rdoc_files: []
|
277
277
|
files:
|
278
|
+
- ".coveralls.yml"
|
278
279
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
279
280
|
- ".github/ISSUE_TEMPLATE/enhancement.md"
|
280
281
|
- ".github/ISSUE_TEMPLATE/question.md"
|
281
282
|
- ".gitignore"
|
283
|
+
- ".gitlab-ci.yml"
|
282
284
|
- ".rspec"
|
283
285
|
- ".rubocop.yml"
|
284
|
-
- ".travis.yml"
|
285
286
|
- Appraisals
|
286
287
|
- CHANGELOG.md
|
287
288
|
- Gemfile
|
@@ -302,6 +303,7 @@ files:
|
|
302
303
|
- bin/setup
|
303
304
|
- config/locales/en.yml
|
304
305
|
- config/routes.rb
|
306
|
+
- docs/usage/reset_password_flow.md
|
305
307
|
- graphql_devise.gemspec
|
306
308
|
- lib/generators/graphql_devise/install_generator.rb
|
307
309
|
- lib/graphql_devise.rb
|
@@ -338,8 +340,10 @@ files:
|
|
338
340
|
- lib/graphql_devise/mutations/logout.rb
|
339
341
|
- lib/graphql_devise/mutations/resend_confirmation.rb
|
340
342
|
- lib/graphql_devise/mutations/send_password_reset.rb
|
343
|
+
- lib/graphql_devise/mutations/send_password_reset_with_token.rb
|
341
344
|
- lib/graphql_devise/mutations/sign_up.rb
|
342
345
|
- lib/graphql_devise/mutations/update_password.rb
|
346
|
+
- lib/graphql_devise/mutations/update_password_with_token.rb
|
343
347
|
- lib/graphql_devise/rails/routes.rb
|
344
348
|
- lib/graphql_devise/resolvers/base.rb
|
345
349
|
- lib/graphql_devise/resolvers/check_password_token.rb
|
@@ -362,6 +366,7 @@ files:
|
|
362
366
|
- spec/dummy/app/graphql/interpreter_schema.rb
|
363
367
|
- spec/dummy/app/graphql/mutations/login.rb
|
364
368
|
- spec/dummy/app/graphql/mutations/register_confirmed_user.rb
|
369
|
+
- spec/dummy/app/graphql/mutations/reset_admin_password_with_token.rb
|
365
370
|
- spec/dummy/app/graphql/mutations/sign_up.rb
|
366
371
|
- spec/dummy/app/graphql/mutations/update_user.rb
|
367
372
|
- spec/dummy/app/graphql/resolvers/confirm_admin_account.rb
|
@@ -428,6 +433,7 @@ files:
|
|
428
433
|
- spec/factories/users.rb
|
429
434
|
- spec/factories/users_customers.rb
|
430
435
|
- spec/generators/graphql_devise/install_generator_spec.rb
|
436
|
+
- spec/graphql/user_queries_spec.rb
|
431
437
|
- spec/graphql_devise/model/with_email_updater_spec.rb
|
432
438
|
- spec/graphql_devise_spec.rb
|
433
439
|
- spec/models/user_spec.rb
|
@@ -439,10 +445,13 @@ files:
|
|
439
445
|
- spec/requests/mutations/logout_spec.rb
|
440
446
|
- spec/requests/mutations/resend_confirmation_spec.rb
|
441
447
|
- spec/requests/mutations/send_password_reset_spec.rb
|
448
|
+
- spec/requests/mutations/send_password_reset_with_token_spec.rb
|
442
449
|
- spec/requests/mutations/sign_up_spec.rb
|
443
450
|
- spec/requests/mutations/update_password_spec.rb
|
451
|
+
- spec/requests/mutations/update_password_with_token_spec.rb
|
444
452
|
- spec/requests/queries/check_password_token_spec.rb
|
445
453
|
- spec/requests/queries/confirm_account_spec.rb
|
454
|
+
- spec/requests/queries/introspection_query_spec.rb
|
446
455
|
- spec/requests/user_controller_spec.rb
|
447
456
|
- spec/services/mount_method/operation_preparer_spec.rb
|
448
457
|
- spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb
|
@@ -465,6 +474,7 @@ files:
|
|
465
474
|
- spec/services/schema_plugin_spec.rb
|
466
475
|
- spec/spec_helper.rb
|
467
476
|
- spec/support/contexts/graphql_request.rb
|
477
|
+
- spec/support/contexts/schema_test.rb
|
468
478
|
- spec/support/factory_bot.rb
|
469
479
|
- spec/support/matchers/auth_headers_matcher.rb
|
470
480
|
- spec/support/matchers/not_change_matcher.rb
|
@@ -476,7 +486,7 @@ licenses:
|
|
476
486
|
metadata:
|
477
487
|
homepage_uri: https://github.com/graphql-devise/graphql_devise
|
478
488
|
source_code_uri: https://github.com/graphql-devise/graphql_devise
|
479
|
-
post_install_message:
|
489
|
+
post_install_message:
|
480
490
|
rdoc_options: []
|
481
491
|
require_paths:
|
482
492
|
- lib
|
@@ -491,8 +501,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
491
501
|
- !ruby/object:Gem::Version
|
492
502
|
version: '0'
|
493
503
|
requirements: []
|
494
|
-
rubygems_version: 3.
|
495
|
-
signing_key:
|
504
|
+
rubygems_version: 3.0.3
|
505
|
+
signing_key:
|
496
506
|
specification_version: 4
|
497
507
|
summary: GraphQL queries and mutations on top of devise_token_auth
|
498
508
|
test_files:
|
@@ -505,6 +515,7 @@ test_files:
|
|
505
515
|
- spec/dummy/app/graphql/interpreter_schema.rb
|
506
516
|
- spec/dummy/app/graphql/mutations/login.rb
|
507
517
|
- spec/dummy/app/graphql/mutations/register_confirmed_user.rb
|
518
|
+
- spec/dummy/app/graphql/mutations/reset_admin_password_with_token.rb
|
508
519
|
- spec/dummy/app/graphql/mutations/sign_up.rb
|
509
520
|
- spec/dummy/app/graphql/mutations/update_user.rb
|
510
521
|
- spec/dummy/app/graphql/resolvers/confirm_admin_account.rb
|
@@ -571,6 +582,7 @@ test_files:
|
|
571
582
|
- spec/factories/users.rb
|
572
583
|
- spec/factories/users_customers.rb
|
573
584
|
- spec/generators/graphql_devise/install_generator_spec.rb
|
585
|
+
- spec/graphql/user_queries_spec.rb
|
574
586
|
- spec/graphql_devise/model/with_email_updater_spec.rb
|
575
587
|
- spec/graphql_devise_spec.rb
|
576
588
|
- spec/models/user_spec.rb
|
@@ -582,10 +594,13 @@ test_files:
|
|
582
594
|
- spec/requests/mutations/logout_spec.rb
|
583
595
|
- spec/requests/mutations/resend_confirmation_spec.rb
|
584
596
|
- spec/requests/mutations/send_password_reset_spec.rb
|
597
|
+
- spec/requests/mutations/send_password_reset_with_token_spec.rb
|
585
598
|
- spec/requests/mutations/sign_up_spec.rb
|
586
599
|
- spec/requests/mutations/update_password_spec.rb
|
600
|
+
- spec/requests/mutations/update_password_with_token_spec.rb
|
587
601
|
- spec/requests/queries/check_password_token_spec.rb
|
588
602
|
- spec/requests/queries/confirm_account_spec.rb
|
603
|
+
- spec/requests/queries/introspection_query_spec.rb
|
589
604
|
- spec/requests/user_controller_spec.rb
|
590
605
|
- spec/services/mount_method/operation_preparer_spec.rb
|
591
606
|
- spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb
|
@@ -608,6 +623,7 @@ test_files:
|
|
608
623
|
- spec/services/schema_plugin_spec.rb
|
609
624
|
- spec/spec_helper.rb
|
610
625
|
- spec/support/contexts/graphql_request.rb
|
626
|
+
- spec/support/contexts/schema_test.rb
|
611
627
|
- spec/support/factory_bot.rb
|
612
628
|
- spec/support/matchers/auth_headers_matcher.rb
|
613
629
|
- spec/support/matchers/not_change_matcher.rb
|
data/.travis.yml
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
sudo: false
|
4
|
-
cache: bundler
|
5
|
-
before_install: gem install bundler -v 1.17
|
6
|
-
before_script: RAILS_ENV=test bundle exec rake db:create db:schema:load
|
7
|
-
|
8
|
-
env: EAGER_LOAD=true
|
9
|
-
|
10
|
-
rvm:
|
11
|
-
- 2.2.10
|
12
|
-
- 2.3.8
|
13
|
-
- 2.4.10
|
14
|
-
- 2.5.8
|
15
|
-
- 2.6.6
|
16
|
-
- 2.7.1
|
17
|
-
|
18
|
-
gemfile:
|
19
|
-
- gemfiles/rails4.2_graphql1.8.gemfile
|
20
|
-
- gemfiles/rails5.0_graphql1.8.gemfile
|
21
|
-
- gemfiles/rails5.0_graphql1.9.gemfile
|
22
|
-
- gemfiles/rails5.1_graphql1.8.gemfile
|
23
|
-
- gemfiles/rails5.1_graphql1.9.gemfile
|
24
|
-
- gemfiles/rails5.2_graphql1.8.gemfile
|
25
|
-
- gemfiles/rails5.2_graphql1.9.gemfile
|
26
|
-
- gemfiles/rails5.2_graphql1.10.gemfile
|
27
|
-
- gemfiles/rails5.2_graphql1.11.gemfile
|
28
|
-
|
29
|
-
jobs:
|
30
|
-
include:
|
31
|
-
- gemfile: gemfiles/rails6.0_graphql1.8.gemfile
|
32
|
-
rvm: 2.5.8
|
33
|
-
- gemfile: gemfiles/rails6.0_graphql1.8.gemfile
|
34
|
-
rvm: 2.6.6
|
35
|
-
- gemfile: gemfiles/rails6.0_graphql1.8.gemfile
|
36
|
-
rvm: 2.7.1
|
37
|
-
- gemfile: gemfiles/rails6.0_graphql1.9.gemfile
|
38
|
-
rvm: 2.5.8
|
39
|
-
- gemfile: gemfiles/rails6.0_graphql1.9.gemfile
|
40
|
-
rvm: 2.6.6
|
41
|
-
- gemfile: gemfiles/rails6.0_graphql1.9.gemfile
|
42
|
-
rvm: 2.7.1
|
43
|
-
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
|
44
|
-
rvm: 2.5.8
|
45
|
-
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
|
46
|
-
rvm: 2.6.6
|
47
|
-
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
|
48
|
-
rvm: 2.7.1
|
49
|
-
- gemfile: gemfiles/rails6.0_graphql1.11.gemfile
|
50
|
-
rvm: 2.5.8
|
51
|
-
- gemfile: gemfiles/rails6.0_graphql1.11.gemfile
|
52
|
-
rvm: 2.6.6
|
53
|
-
- gemfile: gemfiles/rails6.0_graphql1.11.gemfile
|
54
|
-
rvm: 2.7.1
|
55
|
-
- gemfile: gemfiles/rails6.0_graphql_edge.gemfile
|
56
|
-
rvm: 2.6.6
|
57
|
-
env:
|
58
|
-
- SKIP_COVERALLS=true
|
59
|
-
- EAGER_LOAD=true
|
60
|
-
- gemfile: gemfiles/rails6.0_graphql_edge.gemfile
|
61
|
-
rvm: 2.7.1
|
62
|
-
env:
|
63
|
-
- SKIP_COVERALLS=true
|
64
|
-
- EAGER_LOAD=true
|
65
|
-
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
|
66
|
-
rvm: 2.7.1
|
67
|
-
env:
|
68
|
-
- SKIP_COVERALLS=true
|
69
|
-
- EAGER_LOAD=true
|
70
|
-
exclude:
|
71
|
-
- gemfile: gemfiles/rails4.2_graphql1.8.gemfile
|
72
|
-
rvm: 2.7.1
|
73
|
-
allow_failures:
|
74
|
-
- rvm: 2.6.6
|
75
|
-
gemfile: gemfiles/rails6.0_graphql_edge.gemfile
|
76
|
-
- rvm: 2.7.1
|
77
|
-
gemfile: gemfiles/rails6.0_graphql_edge.gemfile
|
78
|
-
- rvm: 2.7.1
|
79
|
-
gemfile: gemfiles/rails_edge_graphql_edge.gemfile
|