Class: Thanos::API::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/thanos/api/authentication.rb

Class Method Summary collapse

Class Method Details

.getObject



8
9
10
11
12
13
14
15
# File 'lib/thanos/api/authentication.rb', line 8

def get
  public_api_key = Thanos.authentication.public_api_key
  private_api_key = Thanos.authentication.private_api_key
  timestamp = Time.now.to_i.to_s
  hash = Digest::MD5.hexdigest(
    timestamp + private_api_key + public_api_key)
  { ts: timestamp, apikey: public_api_key, hash: hash }
end