From 4d07b23047d17e42eb4630cbc758cc2f671ee986 Mon Sep 17 00:00:00 2001 From: Daniel DeLeo Date: Wed, 21 Jul 2010 17:19:35 -0700 Subject: [CHEF-761] ostructs and extend both are very slow --- lib/mixlib/authentication/signedheaderauth.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1