Sha256: 982af839bbba2a06c6b9a9c49498ee6a0861ccc3d2a9889b4d834d10180dcd32

Contents?: true

Size: 583 Bytes

Versions: 5

Compression:

Stored size: 583 Bytes

Contents

require 'fog/core'
require 'uri'

module Fog
  module Cloudstack

    extend Fog::Provider

    service(:compute, 'cloudstack/compute','Compute')

    @@digest  = OpenSSL::Digest::Digest.new('sha1')

    def self.escape(string)
      string = CGI::escape(string)
      string = string.gsub("+","%20")
      string
    end

    def self.signed_params(key,params)
      query = params.to_a.sort.collect{|c| "#{c[0]}=#{escape(c[1].to_s)}"}.join('&').downcase

      signed_string = Base64.encode64(OpenSSL::HMAC.digest(@@digest,key,query)).strip

      signed_string
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
michiels-fog-1.3.1 lib/fog/cloudstack.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/cloudstack.rb
fog-1.3.1 lib/fog/cloudstack.rb
fog-1.3.0 lib/fog/cloudstack.rb
fog-1.2.0 lib/fog/cloudstack.rb