Module: Warden::JWTAuth
- Extended by:
- Dry::Configurable
- Defined in:
- lib/warden/jwt_auth.rb,
lib/warden/jwt_auth/hooks.rb,
lib/warden/jwt_auth/errors.rb,
lib/warden/jwt_auth/version.rb,
lib/warden/jwt_auth/strategy.rb,
lib/warden/jwt_auth/env_helper.rb,
lib/warden/jwt_auth/interfaces.rb,
lib/warden/jwt_auth/middleware.rb,
lib/warden/jwt_auth/user_decoder.rb,
lib/warden/jwt_auth/user_encoder.rb,
lib/warden/jwt_auth/header_parser.rb,
lib/warden/jwt_auth/token_decoder.rb,
lib/warden/jwt_auth/token_encoder.rb,
lib/warden/jwt_auth/token_revoker.rb,
lib/warden/jwt_auth/payload_user_helper.rb,
lib/warden/jwt_auth/middleware/token_dispatcher.rb,
lib/warden/jwt_auth/middleware/revocation_manager.rb
Overview
JWT authentication plugin for warden.
It consists of a strategy which tries to authenticate an user decoding a token present in the ‘Authentication` header (as `Bearer %token%`). From it, it takes the `sub` claim and provides it to a configured repository of users for the current scope.
It also consists of two rack middlewares which perform two actions for configured request paths: dispatching a token for a signed in user and revoking an incoming token.
Defined Under Namespace
Modules: EnvHelper, Errors, HeaderParser, Interfaces, PayloadUserHelper Classes: Hooks, Middleware, Strategy, TokenDecoder, TokenEncoder, TokenRevoker, UserDecoder, UserEncoder
Constant Summary collapse
- Import =
Dry::AutoInject(config)
- VERSION =
'0.4.2'
Class Method Summary collapse
-
.symbolize_keys(hash) ⇒ Object
:reek:UtilityFunction.
-
.upcase_first_items(array) ⇒ Object
:reek:UtilityFunction.
Class Method Details
.symbolize_keys(hash) ⇒ Object
:reek:UtilityFunction
82 83 84 85 86 87 88 |
# File 'lib/warden/jwt_auth.rb', line 82 def self.symbolize_keys(hash) Hash[ hash.each_pair do |key, value| [key.to_sym, value] end ] end |
.upcase_first_items(array) ⇒ Object
:reek:UtilityFunction
91 92 93 94 95 96 |
# File 'lib/warden/jwt_auth.rb', line 91 def self.upcase_first_items(array) array.map do |tuple| method, path = tuple [method.to_s.upcase, path] end end |