Class: Whoosh::App::AuthBuilder
- Inherits:
-
Object
- Object
- Whoosh::App::AuthBuilder
- Defined in:
- lib/whoosh/app.rb
Overview
— DSL Builders —
Instance Method Summary collapse
- #api_key(header: "X-Api-Key", keys: {}) ⇒ Object
- #build ⇒ Object
-
#initialize ⇒ AuthBuilder
constructor
A new instance of AuthBuilder.
- #jwt(secret:, algorithm: :hs256, expiry: 3600) ⇒ Object
- #oauth2(provider: :custom, **opts) ⇒ Object
Constructor Details
#initialize ⇒ AuthBuilder
Returns a new instance of AuthBuilder.
686 687 688 |
# File 'lib/whoosh/app.rb', line 686 def initialize @strategies = {} end |
Instance Method Details
#api_key(header: "X-Api-Key", keys: {}) ⇒ Object
690 691 692 |
# File 'lib/whoosh/app.rb', line 690 def api_key(header: "X-Api-Key", keys: {}) @strategies[:api_key] = Auth::ApiKey.new(keys: keys, header: header) end |
#build ⇒ Object
702 703 704 |
# File 'lib/whoosh/app.rb', line 702 def build @strategies.values.first end |