api_guard_grape 0.5.4 → 0.5.5

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -37
  3. data/Rakefile +1 -1
  4. data/app/controllers/{api_guard_grape → api_guard}/application_controller.rb +1 -1
  5. data/app/controllers/{api_guard_grape → api_guard}/authentication_controller.rb +6 -6
  6. data/app/controllers/{api_guard_grape → api_guard}/passwords_controller.rb +4 -4
  7. data/app/controllers/{api_guard_grape → api_guard}/registration_controller.rb +4 -4
  8. data/app/controllers/{api_guard_grape → api_guard}/tokens_controller.rb +6 -6
  9. data/config/locales/en.yml +1 -1
  10. data/config/routes.rb +2 -2
  11. data/lib/{api_guard_grape.rb → api_guard.rb} +9 -9
  12. data/lib/{api_guard_grape → api_guard}/app_secret_key.rb +1 -1
  13. data/lib/{api_guard_grape → api_guard}/engine.rb +4 -4
  14. data/lib/{api_guard_grape → api_guard}/jwt_auth/authentication.rb +16 -16
  15. data/lib/{api_guard_grape → api_guard}/jwt_auth/blacklist_token.rb +1 -1
  16. data/lib/api_guard/jwt_auth/json_web_token.rb +143 -0
  17. data/lib/{api_guard_grape/jwt_auth/json_web_token.rb → api_guard/jwt_auth/refresh_jwt_token.rb} +10 -107
  18. data/lib/api_guard/models/concerns.rb +27 -0
  19. data/lib/api_guard/modules.rb +26 -0
  20. data/lib/{api_guard_grape → api_guard}/resource_mapper.rb +3 -3
  21. data/lib/{api_guard_grape → api_guard}/response_formatters/renderer.rb +3 -3
  22. data/lib/{api_guard_grape → api_guard}/route_mapper.rb +10 -10
  23. data/lib/api_guard/test/controller_helper.rb +13 -0
  24. data/lib/api_guard/version.rb +5 -0
  25. data/lib/generators/{api_guard_grape → api_guard}/controllers/USAGE +1 -1
  26. data/lib/generators/{api_guard_grape → api_guard}/controllers/controllers_generator.rb +1 -1
  27. data/lib/generators/{api_guard_grape → api_guard}/controllers/templates/authentication_controller.rb +5 -5
  28. data/lib/generators/{api_guard_grape → api_guard}/controllers/templates/passwords_controller.rb +3 -3
  29. data/lib/generators/{api_guard_grape → api_guard}/controllers/templates/registration_controller.rb +3 -3
  30. data/lib/generators/{api_guard_grape → api_guard}/controllers/templates/tokens_controller.rb +5 -5
  31. data/lib/generators/{api_guard_grape → api_guard}/initializer/USAGE +2 -2
  32. data/lib/generators/{api_guard_grape → api_guard}/initializer/initializer_generator.rb +2 -2
  33. data/lib/generators/{api_guard_grape → api_guard}/initializer/templates/initializer.rb +1 -1
  34. metadata +30 -30
  35. data/lib/api_guard_grape/jwt_auth/refresh_jwt_token.rb +0 -46
  36. data/lib/api_guard_grape/models/concerns.rb +0 -27
  37. data/lib/api_guard_grape/modules.rb +0 -26
  38. data/lib/api_guard_grape/test/controller_helper.rb +0 -13
  39. data/lib/api_guard_grape/version.rb +0 -5
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApiGuardGrape
4
- module Models
5
- module Concerns
6
- extend ActiveSupport::Concern
7
-
8
- class_methods do
9
- def api_guard_grape_associations(refresh_token: nil, blacklisted_token: nil)
10
- return if ApiGuardGrape.api_guard_grape_associations[name]
11
-
12
- ApiGuardGrape.api_guard_grape_associations[name] = {}
13
- ApiGuardGrape.api_guard_grape_associations[name][:refresh_token] = refresh_token
14
- ApiGuardGrape.api_guard_grape_associations[name][:blacklisted_token] = blacklisted_token
15
- end
16
-
17
- def refresh_token_association
18
- ApiGuardGrape.api_guard_grape_associations.dig(name, :refresh_token)
19
- end
20
-
21
- def blacklisted_token_association
22
- ApiGuardGrape.api_guard_grape_associations.dig(name, :blacklisted_token)
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'api_guard_grape/resource_mapper'
4
- require 'api_guard_grape/jwt_auth/json_web_token'
5
- require 'api_guard_grape/jwt_auth/authentication'
6
- require 'api_guard_grape/jwt_auth/refresh_jwt_token'
7
- require 'api_guard_grape/jwt_auth/blacklist_token'
8
- require 'api_guard_grape/response_formatters/renderer'
9
- require 'api_guard_grape/models/concerns'
10
-
11
- module ApiGuardGrape
12
- module Modules
13
- ActiveSupport.on_load(:action_controller) do
14
- include ApiGuardGrape::Resource
15
- include ApiGuardGrape::JwtAuth::JsonWebToken
16
- include ApiGuardGrape::JwtAuth::Authentication
17
- include ApiGuardGrape::JwtAuth::RefreshJwtToken
18
- include ApiGuardGrape::JwtAuth::BlacklistToken
19
- include ApiGuardGrape::ResponseFormatters::Renderer
20
- end
21
-
22
- ActiveSupport.on_load(:active_record) do
23
- include ApiGuardGrape::Models::Concerns
24
- end
25
- end
26
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'api_guard_grape/jwt_auth/json_web_token'
4
- require 'api_guard_grape/jwt_auth/refresh_jwt_token'
5
-
6
- module ApiGuardGrape
7
- module Test
8
- module ControllerHelper
9
- include ApiGuardGrape::JwtAuth::JsonWebToken
10
- include ApiGuardGrape::JwtAuth::RefreshJwtToken
11
- end
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApiGuardGrape
4
- VERSION = '0.5.4'
5
- end