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.
672 673 674 |
# File 'lib/whoosh/app.rb', line 672 def initialize @strategies = {} end |
Instance Method Details
#api_key(header: "X-Api-Key", keys: {}) ⇒ Object
676 677 678 |
# File 'lib/whoosh/app.rb', line 676 def api_key(header: "X-Api-Key", keys: {}) @strategies[:api_key] = Auth::ApiKey.new(keys: keys, header: header) end |
#build ⇒ Object
688 689 690 |
# File 'lib/whoosh/app.rb', line 688 def build @strategies.values.first end |