Class: JWTSignedRequest::Verify

Inherits:
Object
  • Object
show all
Defined in:
lib/jwt_signed_request/verify.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request:, secret_key: nil, algorithm: nil, leeway: nil) ⇒ Verify

TODO: secret_key & algorithm is deprecated and will be removed in future. For now we will support its functionaility



12
13
14
15
16
17
# File 'lib/jwt_signed_request/verify.rb', line 12

def initialize(request:, secret_key: nil, algorithm: nil, leeway: nil)
  @request = request
  @secret_key = secret_key
  @algorithm = algorithm
  @leeway = leeway
end

Class Method Details

.call(*args) ⇒ Object



6
7
8
# File 'lib/jwt_signed_request/verify.rb', line 6

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



19
20
21
22
23
24
25
# File 'lib/jwt_signed_request/verify.rb', line 19

def call
  if jwt_token.nil?
    raise MissingAuthorizationHeaderError, "Missing Authorization header in the request"
  end

  verify_request!
end