Module: JWTSignedRequest
- Extended by:
- JWTSignedRequest
- Included in:
- JWTSignedRequest
- Defined in:
- lib/jwt_signed_request/headers.rb,
lib/jwt_signed_request.rb,
lib/jwt_signed_request/sign.rb,
lib/jwt_signed_request/claims.rb,
lib/jwt_signed_request/verify.rb,
lib/jwt_signed_request/version.rb,
lib/jwt_signed_request/key_store.rb,
lib/jwt_signed_request/middlewares/rack.rb,
lib/jwt_signed_request/middlewares/faraday.rb
Overview
We need a way to pull out the headers from a RAW Rack ENV hash.
We took out the bits we need to lookup the headers from: github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/http/headers.rb
We didn’t want to include actionpack as a dependency of the library as it brings in alot of other dependencies.
Defined Under Namespace
Modules: Middlewares Classes: Claims, Headers, KeyStore, Sign, Verify
Constant Summary collapse
- DEFAULT_ALGORITHM =
'ES256'.freeze
- EMPTY_BODY =
"".freeze
Class.new(StandardError)
- MissingAuthorizationHeaderError =
Class.new()
- JWTDecodeError =
Class.new()
- RequestVerificationFailedError =
Class.new()
- MissingKeyIdError =
Class.new()
- UnknownKeyIdError =
Class.new()
- AlgorithmMismatchError =
Class.new()
- VERSION =
"2.1.2".freeze
Instance Method Summary collapse
- #configure_keys {|key_store| ... } ⇒ Object
- #key_store ⇒ Object
- #sign(*args) ⇒ Object
- #verify(*args) ⇒ Object
Instance Method Details
#configure_keys {|key_store| ... } ⇒ Object
20 21 22 |
# File 'lib/jwt_signed_request.rb', line 20 def configure_keys yield(key_store) end |
#key_store ⇒ Object
24 25 26 |
# File 'lib/jwt_signed_request.rb', line 24 def key_store @key_store ||= KeyStore.new end |
#sign(*args) ⇒ Object
28 29 30 |
# File 'lib/jwt_signed_request.rb', line 28 def sign(*args) Sign.call(*args) end |
#verify(*args) ⇒ Object
32 33 34 |
# File 'lib/jwt_signed_request.rb', line 32 def verify(*args) Verify.call(*args) end |