Class: Himari::Middlewares::SigningKey
- Inherits:
-
Object
- Object
- Himari::Middlewares::SigningKey
- Defined in:
- lib/himari/middlewares/signing_key.rb
Constant Summary collapse
- RACK_KEY =
'himari.signing_keys'
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#signing_key ⇒ Object
readonly
Returns the value of attribute signing_key.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, kwargs = {}) ⇒ SigningKey
constructor
A new instance of SigningKey.
Constructor Details
#initialize(app, kwargs = {}) ⇒ SigningKey
9 10 11 12 13 |
# File 'lib/himari/middlewares/signing_key.rb', line 9 def initialize(app, kwargs = {}) @app = app @signing_key = Himari::SigningKey.new(**kwargs) @provider = Himari::ItemProviders::Static.new([@signing_key]) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
15 16 17 |
# File 'lib/himari/middlewares/signing_key.rb', line 15 def app @app end |
#signing_key ⇒ Object (readonly)
Returns the value of attribute signing_key.
15 16 17 |
# File 'lib/himari/middlewares/signing_key.rb', line 15 def signing_key @signing_key end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 |
# File 'lib/himari/middlewares/signing_key.rb', line 17 def call(env) env[RACK_KEY] ||= [] env[RACK_KEY] += [@provider] @app.call(env) end |