Class: Faraday::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/faraday/auth-hmac.rb

Defined Under Namespace

Classes: AuthHMAC

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sign_withObject

Returns the value of attribute sign_with.



11
12
13
# File 'lib/faraday/auth-hmac.rb', line 11

def sign_with
  @sign_with
end

Instance Method Details

#original_to_envObject

Include the ‘sign_with` property to ensure the request is signed with the specified `access_id`.



21
# File 'lib/faraday/auth-hmac.rb', line 21

alias_method :original_to_env, :to_env

#sign!(access_id, secret) ⇒ Object

Sign the request with the specified ‘access_id` and `secret`.



14
15
16
17
# File 'lib/faraday/auth-hmac.rb', line 14

def sign!(access_id, secret)
  AuthHMAC.keys[access_id] = secret
  self.sign_with = access_id
end

#to_env(connection) ⇒ Object



22
23
24
# File 'lib/faraday/auth-hmac.rb', line 22

def to_env(connection)
  original_to_env(connection).merge(:sign_with => self.sign_with)
end