Class: Yoti::SignedRequest
- Inherits:
-
Object
- Object
- Yoti::SignedRequest
- Defined in:
- lib/yoti/http/signed_request.rb
Overview
Converts a basic Net::HTTP request into a Yoti Signed Request
Instance Method Summary collapse
-
#initialize(unsigned_request, path, payload = {}) ⇒ SignedRequest
constructor
A new instance of SignedRequest.
- #sign ⇒ Net::HTTPRequest
Constructor Details
#initialize(unsigned_request, path, payload = {}) ⇒ SignedRequest
Returns a new instance of SignedRequest.
11 12 13 14 15 16 |
# File 'lib/yoti/http/signed_request.rb', line 11 def initialize(unsigned_request, path, payload = {}) @http_req = unsigned_request @path = path @payload = payload @auth_key = Yoti::SSL.auth_key_from_pem end |
Instance Method Details
#sign ⇒ Net::HTTPRequest
21 22 23 24 25 26 |
# File 'lib/yoti/http/signed_request.rb', line 21 def sign @http_req['X-Yoti-Auth-Digest'] = @http_req['X-Yoti-SDK'] = Yoti.configuration.sdk_identifier @http_req['X-Yoti-SDK-Version'] = "#{Yoti.configuration.sdk_identifier}-#{Yoti::VERSION}" @http_req end |