Sha256: f023cb13872d30c806b944bd96752e934b99f87969fccaeaad71c85e182b322c

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

require 'digest/md5'
require 'thanos/authentication'

module Thanos
  module API
    class Authentication
      class << self
        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 lib/thanos/api/authentication.rb
thanos-0.5.0 lib/thanos/api/authentication.rb