Class: Apollo::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo/auth.rb

Overview

Authorization

Class Method Summary collapse

Class Method Details

.signature(secret, timestamp, path_with_query) ⇒ Object



10
11
12
13
14
15
# File 'lib/apollo/auth.rb', line 10

def signature(secret, timestamp, path_with_query)
  return if secret.nil?

  sign = "#{timestamp}\n#{path_with_query}"
  Base64.encode64(OpenSSL::HMAC.digest("sha1", secret, sign))
end