devise_jwt_auth 0.1.1 → 0.1.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.
Files changed (16) hide show
  1. checksums.yaml +4 -4
  2. data/app/validators/devise_jwt_auth_email_validator.rb +1 -1
  3. data/lib/devise_jwt_auth/version.rb +1 -1
  4. data/test/dummy/db/migrate/{20140715061447_devise_token_auth_create_users.rb → 20140715061447_devise_jwt_auth_create_users.rb} +0 -0
  5. data/test/dummy/db/migrate/{20140715061805_devise_token_auth_create_mangs.rb → 20140715061805_devise_jwt_auth_create_mangs.rb} +0 -0
  6. data/test/dummy/db/migrate/{20141222035835_devise_token_auth_create_only_email_users.rb → 20141222035835_devise_jwt_auth_create_only_email_users.rb} +0 -0
  7. data/test/dummy/db/migrate/{20141222053502_devise_token_auth_create_unregisterable_users.rb → 20141222053502_devise_jwt_auth_create_unregisterable_users.rb} +0 -0
  8. data/test/dummy/db/migrate/{20150708104536_devise_token_auth_create_unconfirmable_users.rb → 20150708104536_devise_jwt_auth_create_unconfirmable_users.rb} +0 -0
  9. data/test/dummy/db/migrate/{20160103235141_devise_token_auth_create_scoped_users.rb → 20160103235141_devise_jwt_auth_create_scoped_users.rb} +0 -0
  10. data/test/dummy/db/migrate/{20160629184441_devise_token_auth_create_lockable_users.rb → 20160629184441_devise_jwt_auth_create_lockable_users.rb} +0 -0
  11. data/test/dummy/db/migrate/{20190924101113_devise_token_auth_create_confirmable_users.rb → 20190924101113_devise_jwt_auth_create_confirmable_users.rb} +0 -0
  12. data/test/dummy/tmp/generators/app/controllers/application_controller.rb +6 -0
  13. data/test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb +9 -0
  14. data/test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb +74 -0
  15. data/test/dummy/tmp/generators/db/migrate/20200209222205_devise_jwt_auth_create_azpire_v1_human_resource_users.rb +51 -0
  16. metadata +26 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5696b7fd28731ae8f1b92ea62e27e19849e338414f2ceb3e4c34f8d0f9d01bb1
4
- data.tar.gz: 8c87dbf4b8fd5fc5042f5ad43bbddcd1f779f0fac58731df84376c060f1f368a
3
+ metadata.gz: 7a06bae3070382b9905364b56303bf4d376da0437477e866a7a4ac58cfabb5c3
4
+ data.tar.gz: e894ad6a70d6a44d8aaa83cc4d1b0b5e82ad1a7f145915136394bf96b473db68
5
5
  SHA512:
6
- metadata.gz: 5000f849307719199b1b8de4495bc6f283fff8e0f24da5e6bc61020552789886479ad99c81458083824232b6519f97b2913bbd768c73a7eae2f1525480fad509
7
- data.tar.gz: a1ee99b078d18ebda654ba0eb64922b8b0449dc90c3794ca72d76cac38ae1d948cafa962531087020d58d49862287c9ba7b955e7d6f5056fa9447f267f3298d4
6
+ metadata.gz: 3da140cf6afd0bf79e0b39a360b40e85e27b56baa2a66f8893776559f4b67d47d8381b868bcee2807d944ee0806e37ac8e7e3d2dd083ecb7766d36ae3aeb207c
7
+ data.tar.gz: 187054dab5d7c21e0571c7f4a8720caabd45717401edb299dffe302eac57433ffe2eff25b8e7edaef092611d04a55f92de75fb22a817873fdafdcd8856fc37c7
@@ -14,7 +14,7 @@ class DeviseJwtAuthEmailValidator < ActiveModel::EachValidator
14
14
  message = options[:message]
15
15
 
16
16
  if message.nil?
17
- # Try DeviceTokenAuth translations or fallback to ActiveModel translations
17
+ # Try DeviseJwtAuth translations or fallback to ActiveModel translations
18
18
  message = I18n.t(:'errors.messages.not_email', default: :'errors.messages.invalid')
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeviseJwtAuth
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'.freeze
5
5
  end
@@ -0,0 +1,6 @@
1
+ class ApplicationController < ActionController::Base
2
+ include DeviseJwtAuth::Concerns::SetUserByToken
3
+ def whatever
4
+ 'whatever'
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Azpire::V1::HumanResource::User < ActiveRecord::Base
4
+ # Include default devise modules. Others available are:
5
+ # :confirmable, :lockable, :timeoutable and :omniauthable
6
+ devise :database_authenticatable, :registerable,
7
+ :recoverable, :rememberable, :trackable, :validatable
8
+ include DeviseJwtAuth::Concerns::User
9
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ DeviseJwtAuth.setup do |config|
4
+ # By default, you will only receive an access token when authenticating a
5
+ # user. To receive new access tokens, you should either reauthenticate or
6
+ # use the HTTP only refresh cookie that is sent during the authentication
7
+ # process and make refresh token requests.
8
+ # self.send_new_access_token_on_each_request = false
9
+
10
+ # By default, refresh token HTTP Only cookies last for 2 weeks. These tokens
11
+ # are used for requesting shorter-lived acccess tokens.
12
+ # self.refresh_token_lifespan = 2.weeks
13
+
14
+ # By default, access tokens last for 15 minutes. These tokens are used to
15
+ # access protected resources. When these tokens expire, you need to
16
+ # reauthenticate the user or use a refresh token cookie to get a new access
17
+ # token.
18
+ # self.access_token_lifespan = 15.minutes
19
+
20
+ # This is the name of the HTTP Only cookie that will be sent to the client
21
+ # for the purpose of requesting new access tokens.
22
+ # self.refresh_token_name = 'refresh-token'
23
+
24
+ # This is the name of the token that will be sent in the JSON responses used
25
+ # for accessing protected resources. NEVER store this token in a cookie or
26
+ # any form of local storage on the client. Save it in memory as a javascript
27
+ # variable or in some kind of context manager like Redux. Send it in your
28
+ # request headers when you want to be authenticated.
29
+ # self.access_token_name = 'access-token'
30
+
31
+ # This is the refresh token encryption key. You should set this in an
32
+ # environment variable or secret key base that isn't store in a repository.
33
+ # Also, its a good idea to NOT use the same key for access tokens.
34
+ self.refresh_token_encryption_key = 'your-refresh-token-secret-key-here'
35
+
36
+ # This is the refresh token encryption key. You should set this in an
37
+ # environment variable or secret key base that isn't store in a repository.
38
+ # Also, its a good idea to NOT use the same key for access tokens.
39
+ self.access_token_encryption_key = 'your-access-token-secret-key-here'
40
+
41
+ # This route will be the prefix for all oauth2 redirect callbacks. For
42
+ # example, using the default '/omniauth', the github oauth2 provider will
43
+ # redirect successful authentications to '/omniauth/github/callback'
44
+ # config.omniauth_prefix = "/omniauth"
45
+
46
+ # By default sending current password is not needed for the password update.
47
+ # Uncomment to enforce current_password param to be checked before all
48
+ # attribute updates. Set it to :password if you want it to be checked only if
49
+ # password is updated.
50
+ # config.check_current_password_before_update = :attributes
51
+
52
+ # By default we will use callbacks for single omniauth.
53
+ # It depends on fields like email, provider and uid.
54
+ # config.default_callbacks = true
55
+
56
+ # By default, only Bearer Token authentication is implemented out of the box.
57
+ # If, however, you wish to integrate with legacy Devise authentication, you can
58
+ # do so by enabling this flag. NOTE: This feature is highly experimental!
59
+ # config.enable_standard_devise_support = false
60
+
61
+ # By default DeviseJwtAuth will not send confirmation email, even when including
62
+ # devise confirmable module. If you want to use devise confirmable module and
63
+ # send email, set it to true. (This is a setting for compatibility)
64
+ # config.send_confirmation_email = true
65
+
66
+ # TODO: Document these settings
67
+ # self.default_confirm_success_url = nil
68
+ # self.default_password_reset_url = nil
69
+ # self.redirect_whitelist = nil
70
+ # self.update_token_version_after_password_reset = true
71
+ # self.bypass_sign_in = true
72
+ # self.require_client_password_reset_token = false
73
+
74
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DeviseJwtAuthCreateAzpireV1HumanResourceUsers < ActiveRecord::Migration[6.0]
4
+ def change
5
+
6
+ create_table(:azpire_v1_human_resource_users) do |t|
7
+ ## Required
8
+ t.string :provider, null: false, default: 'email'
9
+ t.string :uid, null: false, default: ''
10
+
11
+ ## Database authenticatable
12
+ t.string :encrypted_password, null: false, default: ''
13
+
14
+ ## Recoverable
15
+ t.string :reset_password_token
16
+ t.datetime :reset_password_sent_at
17
+ t.boolean :allow_password_change, default: false
18
+
19
+ ## Rememberable
20
+ t.datetime :remember_created_at
21
+
22
+ ## Confirmable
23
+ t.string :confirmation_token
24
+ t.datetime :confirmed_at
25
+ t.datetime :confirmation_sent_at
26
+ t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+ ## User Info
34
+ t.string :name
35
+ t.string :nickname
36
+ t.string :image
37
+ t.string :email
38
+
39
+ ## Tokens
40
+ t.text :tokens
41
+
42
+ t.timestamps
43
+ end
44
+
45
+ add_index :azpire_v1_human_resource_users, :email, unique: true
46
+ add_index :azpire_v1_human_resource_users, [:uid, :provider], unique: true
47
+ add_index :azpire_v1_human_resource_users, :reset_password_token, unique: true
48
+ add_index :azpire_v1_human_resource_users, :confirmation_token, unique: true
49
+ # add_index :azpire_v1_human_resource_users, :unlock_token, unique: true
50
+ end
51
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-08 00:00:00.000000000 Z
11
+ date: 2020-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -336,18 +336,22 @@ files:
336
336
  - test/dummy/config/initializers/wrap_parameters.rb
337
337
  - test/dummy/config/routes.rb
338
338
  - test/dummy/config/spring.rb
339
- - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
340
- - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
339
+ - test/dummy/db/migrate/20140715061447_devise_jwt_auth_create_users.rb
340
+ - test/dummy/db/migrate/20140715061805_devise_jwt_auth_create_mangs.rb
341
341
  - test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
342
342
  - test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb
343
- - test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb
344
- - test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb
345
- - test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
346
- - test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
347
- - test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
348
- - test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
343
+ - test/dummy/db/migrate/20141222035835_devise_jwt_auth_create_only_email_users.rb
344
+ - test/dummy/db/migrate/20141222053502_devise_jwt_auth_create_unregisterable_users.rb
345
+ - test/dummy/db/migrate/20150708104536_devise_jwt_auth_create_unconfirmable_users.rb
346
+ - test/dummy/db/migrate/20160103235141_devise_jwt_auth_create_scoped_users.rb
347
+ - test/dummy/db/migrate/20160629184441_devise_jwt_auth_create_lockable_users.rb
348
+ - test/dummy/db/migrate/20190924101113_devise_jwt_auth_create_confirmable_users.rb
349
349
  - test/dummy/db/schema.rb
350
350
  - test/dummy/lib/migration_database_helper.rb
351
+ - test/dummy/tmp/generators/app/controllers/application_controller.rb
352
+ - test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
353
+ - test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb
354
+ - test/dummy/tmp/generators/db/migrate/20200209222205_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
351
355
  - test/factories/users.rb
352
356
  - test/lib/devise_jwt_auth/blacklist_test.rb
353
357
  - test/lib/devise_jwt_auth/token_factory_test.rb
@@ -402,16 +406,20 @@ test_files:
402
406
  - test/test_helper.rb
403
407
  - test/dummy/lib/migration_database_helper.rb
404
408
  - test/dummy/config.ru
409
+ - test/dummy/tmp/generators/db/migrate/20200209222205_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
410
+ - test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb
411
+ - test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
412
+ - test/dummy/tmp/generators/app/controllers/application_controller.rb
413
+ - test/dummy/db/migrate/20150708104536_devise_jwt_auth_create_unconfirmable_users.rb
405
414
  - test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb
406
415
  - test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
407
- - test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb
408
- - test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb
409
- - test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
410
- - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
411
- - test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
412
- - test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
413
- - test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
414
- - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
416
+ - test/dummy/db/migrate/20141222053502_devise_jwt_auth_create_unregisterable_users.rb
417
+ - test/dummy/db/migrate/20160629184441_devise_jwt_auth_create_lockable_users.rb
418
+ - test/dummy/db/migrate/20160103235141_devise_jwt_auth_create_scoped_users.rb
419
+ - test/dummy/db/migrate/20141222035835_devise_jwt_auth_create_only_email_users.rb
420
+ - test/dummy/db/migrate/20140715061447_devise_jwt_auth_create_users.rb
421
+ - test/dummy/db/migrate/20190924101113_devise_jwt_auth_create_confirmable_users.rb
422
+ - test/dummy/db/migrate/20140715061805_devise_jwt_auth_create_mangs.rb
415
423
  - test/dummy/db/schema.rb
416
424
  - test/dummy/config/application.yml.bk
417
425
  - test/dummy/config/spring.rb