Class: WEB_API::Signed2Method
- Inherits:
-
AuthMethod
- Object
- WebApiMethod
- AuthMethod
- WEB_API::Signed2Method
- Defined in:
- lib/web_api/signed2.rb
Constant Summary
Constants inherited from WebApiMethod
WebApiMethod::OK, WebApiMethod::SCHEMES, WebApiMethod::SSL, WebApiMethod::TYPES
Instance Attribute Summary
Attributes inherited from AuthMethod
Attributes inherited from WebApiMethod
Instance Method Summary collapse
Methods inherited from AuthMethod
Methods inherited from WebApiMethod
#arg_map, #args_map, #escape, #get, #http, #initialize, #kv_map, #parse, #pathquery, #post
Constructor Details
This class inherits a constructor from WEB_API::AuthMethod
Instance Method Details
#call(args) ⇒ Object
18 19 20 21 22 |
# File 'lib/web_api/signed2.rb', line 18 def call(args) tonce = (Time.now.to_f * 1000000).to_i args.push( {:tonce => tonce} ) super(args) end |
#headers(args) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/web_api/signed2.rb', line 4 def headers(args) Signed2.trace.puts "path: #{path}" if Signed2.trace signature = Base64.strict_encode64( OpenSSL::HMAC.digest 'sha512', Base64.decode64(auth[:secret]), path + "\0" + data(args) ) headers = super(args) headers['Rest-Key'] = auth[:key] headers['Rest-Sign'] = signature Signed2.trace.puts "headers:\n#{headers}" if Signed2.trace return headers end |