Class: Auth::SignatureValidator
- Inherits:
-
Object
- Object
- Auth::SignatureValidator
- Defined in:
- app/services/auth/signature_validator.rb
Instance Method Summary collapse
-
#initialize(key = nil, threshold = nil) ⇒ SignatureValidator
constructor
A new instance of SignatureValidator.
- #validate(request) ⇒ Object
Constructor Details
#initialize(key = nil, threshold = nil) ⇒ SignatureValidator
Returns a new instance of SignatureValidator.
5 6 7 8 |
# File 'app/services/auth/signature_validator.rb', line 5 def initialize(key = nil, threshold = nil) @key = key @threshold = threshold end |
Instance Method Details
#validate(request) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/services/auth/signature_validator.rb', line 10 def validate(request) raise Auth::MissingKeyError, 'Signing Key is not set' unless @key.present? = (request) time_header = time_header(request) validate_time!(time_header) validate_signature!(request, , time_header) end |