Class: Hooksmith::Verifiers::Base Abstract
- Inherits:
-
Object
- Object
- Hooksmith::Verifiers::Base
- Defined in:
- lib/hooksmith/verifiers/base.rb
Overview
This class is abstract.
Subclass and override #verify! to implement custom verification.
Base class for webhook request verifiers.
Verifiers are responsible for authenticating incoming webhook requests before they are processed. Each provider can have its own verifier configured to handle provider-specific authentication schemes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
Options passed to the verifier.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Returns whether the verifier is configured and should be used.
-
#initialize(**options) ⇒ Base
constructor
Initializes the verifier with options.
-
#verify!(request) ⇒ void
Verifies the incoming webhook request.
Constructor Details
#initialize(**options) ⇒ Base
Initializes the verifier with options.
34 35 36 |
# File 'lib/hooksmith/verifiers/base.rb', line 34 def initialize(**) @options = end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns options passed to the verifier.
29 30 31 |
# File 'lib/hooksmith/verifiers/base.rb', line 29 def @options end |
Instance Method Details
#enabled? ⇒ Boolean
Returns whether the verifier is configured and should be used.
50 51 52 |
# File 'lib/hooksmith/verifiers/base.rb', line 50 def enabled? true end |
#verify!(request) ⇒ void
This method returns an undefined value.
Verifies the incoming webhook request.
43 44 45 |
# File 'lib/hooksmith/verifiers/base.rb', line 43 def verify!(request) raise NotImplementedError, 'Subclasses must implement #verify!' end |