diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-07-21 17:19:35 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-07-21 17:19:35 -0700 |
commit | 4d07b23047d17e42eb4630cbc758cc2f671ee986 (patch) | |
tree | ddd8d247b6041249bdbc6283f155dd495d9a4d4e /lib | |
parent | 7c06e5feeed09da7c7938007ed52edb0e0c28da2 (diff) | |
download | mixlib-authentication-4d07b23047d17e42eb4630cbc758cc2f671ee986.tar.gz |
[CHEF-761] ostructs and extend both are very slow
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mixlib/authentication/signedheaderauth.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb index 7cc3234..63febb1 100644 --- a/lib/mixlib/authentication/signedheaderauth.rb +++ b/lib/mixlib/authentication/signedheaderauth.rb @@ -25,6 +25,7 @@ require 'mixlib/authentication/digester' module Mixlib module Authentication + module SignedHeaderAuth SIGNING_DESCRIPTION = 'version=1.0' @@ -33,7 +34,7 @@ module Mixlib # with the simple OpenStruct extended with the auth functions class << self def signing_object(args={ }) - OpenStruct.new(args).extend SignedHeaderAuth + SigningObject.new(args[:http_method], args[:path], args[:body], args[:host], args[:timestamp], args[:user_id], args[:file]) end end @@ -121,5 +122,10 @@ module Mixlib private :canonical_time, :canonical_path, :parse_signing_description, :digester end + + class SigningObject < Struct.new(:http_method, :path, :body, :host, :timestamp, :user_id, :file) + include SignedHeaderAuth + end + end end |