<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/atom/configuration.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+== 0.5.1 2008-08-05
+
+* Added AuthHMAC support
+
 == 0.5.0 2008-07-28
 
 * Fix bug where processing instructions break parsing.</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ lib/atom.rb
 lib/atom/pub.rb
 lib/atom/version.rb
 lib/atom/xml/parser.rb
+lib/atom/configuration.rb
 setup.rb
 spec/app/member_entry.atom
 spec/app/service.xml</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@
 #
 
 require 'atom'
+require 'atom/configuration'
 require 'atom/xml/parser'
 require 'atom/version'
 require 'xml/libxml'
@@ -126,6 +127,12 @@ module Atom
           request = Net::HTTP::Post.new(uri.path, headers)
           if opts[:user] &amp;&amp; opts[:pass]
             request.basic_auth(opts[:user], opts[:pass])
+          elsif opts[:hmac_access_id] &amp;&amp; opts[:hmac_secret_key]
+            if Atom::Configuration.auth_hmac_enabled?
+              AuthHMAC.sign!(request, opts[:hmac_access_id], opts[:hmac_secret_key])
+            else
+              raise ArgumentError, &quot;AuthHMAC credentials provides by auth-hmac gem is not installed&quot;
+            end
           end
           response = http.request(request, entry.to_xml.to_s)
         end
@@ -171,7 +178,14 @@ module Atom
           request = Net::HTTP::Put.new(uri.path, headers)
           if opts[:user] &amp;&amp; opts[:pass]
             request.basic_auth(opts[:user], opts[:pass])
+          elsif opts[:hmac_access_id] &amp;&amp; opts[:hmac_secret_key]
+            if Atom::Configuration.auth_hmac_enabled?
+              AuthHMAC.sign!(request, opts[:hmac_access_id], opts[:hmac_secret_key])
+            else
+              raise ArgumentError, &quot;AuthHMAC credentials provides by auth-hmac gem is not installed&quot;
+            end
           end
+          
           response = http.request(request, self.to_xml)
         end
         
@@ -193,7 +207,14 @@ module Atom
           request = Net::HTTP::Delete.new(uri.path, {'Accept' =&gt; 'application/atom+xml', 'User-Agent' =&gt; &quot;rAtom #{Atom::VERSION::STRING}&quot;})
           if opts[:user] &amp;&amp; opts[:pass]
             request.basic_auth(opts[:user], opts[:pass])
+          elsif opts[:hmac_access_id] &amp;&amp; opts[:hmac_secret_key]
+            if Atom::Configuration.auth_hmac_enabled?
+              AuthHMAC.sign!(request, opts[:hmac_access_id], opts[:hmac_secret_key])
+            else
+              raise ArgumentError, &quot;AuthHMAC credentials provides by auth-hmac gem is not installed&quot;
+            end
           end
+          
           response = http.request(request)
         end
         </diff>
      <filename>lib/atom/pub.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module Atom #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 0
     MINOR = 5
-    TINY  = 0
+    TINY  = 1
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/atom/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -248,6 +248,27 @@ describe Atom::Pub do
         created = @collection.publish(entry, :user =&gt; 'user', :pass =&gt; 'pass')
         created.should == entry
       end
+      
+      if Atom::Configuration.auth_hmac_enabled?
+        it &quot;should send a POST with hmac authentication when an entry is published&quot; do  
+          entry = Atom::Entry.load_entry(File.open('spec/fixtures/entry.atom'))      
+                 
+          response = mock_response(Net::HTTPCreated, entry.to_xml.to_s)
+              
+          http = mock('http')
+          http.should_receive(:request) do |request, entry_xml|
+            request['Authorization'].should match(/^AuthHMAC access_id:[a-zA-Z0-9\/+]+=*/)
+            response
+          end
+            
+          Net::HTTP.should_receive(:start).with('example.org', 80).and_yield(http)
+      
+          created = @collection.publish(entry, :hmac_access_id =&gt; 'access_id', :hmac_secret_key =&gt; 'secret')
+          created.should == entry
+        end
+      else
+        xit &quot;should send a POST with hmac authentication when an entry is published&quot;
+      end
     
       it &quot;should behave well when no content is returned&quot; do      
         entry = Atom::Entry.load_entry(File.open('spec/fixtures/entry.atom'))      
@@ -366,6 +387,23 @@ describe Atom::Pub do
       entry.save!(:user =&gt; 'user', :pass =&gt; 'pass')
     end
     
+    if Atom::Configuration.auth_hmac_enabled?
+      it &quot;should send a PUT with hmac auth to the edit link on save!&quot; do
+        entry = Atom::Entry.load_entry(File.open('spec/app/member_entry.atom'))
+        response = mock_response(Net::HTTPSuccess, nil)
+      
+        http = mock('http')
+        http.should_receive(:request) do |request, entry_xml|
+          request['Authorization'].should match(/^AuthHMAC access_id:[a-zA-Z0-9\/+]+=*$/)
+          response
+        end
+        
+        Net::HTTP.should_receive(:start).with('example.org', 80).and_yield(http)
+            
+        entry.save!(:hmac_access_id =&gt; 'access_id', :hmac_secret_key =&gt; 'secret')
+      end
+    end
+    
     it &quot;should send a DELETE to the edit link on delete!&quot; do
       entry = Atom::Entry.load_entry(File.open('spec/app/member_entry.atom'))
       response = mock_response(Net::HTTPSuccess, nil)
@@ -380,20 +418,37 @@ describe Atom::Pub do
       entry.destroy!
     end
     
-     it &quot;should send a DELETE to the edit link on delete!&quot; do
+    it &quot;should send a DELETE with basic auth to the edit link on delete!&quot; do
+      entry = Atom::Entry.load_entry(File.open('spec/app/member_entry.atom'))
+      response = mock_response(Net::HTTPSuccess, nil)
+
+      request = mock('request')
+      request.should_receive(:basic_auth).with('user', 'pass')
+      Net::HTTP::Delete.should_receive(:new).with('/member_entry.atom', an_instance_of(Hash)).and_return(request)
+
+      http = mock('http')
+      http.should_receive(:request).with(request).and_return(response)
+      Net::HTTP.should_receive(:start).with('example.org', 80).and_yield(http)
+
+      entry.destroy!(:user =&gt; 'user', :pass =&gt; 'pass')
+    end
+    
+    if Atom::Configuration.auth_hmac_enabled?
+      it &quot;should send a DELETE with hmac auth to the edit link on delete!&quot; do
         entry = Atom::Entry.load_entry(File.open('spec/app/member_entry.atom'))
         response = mock_response(Net::HTTPSuccess, nil)
 
-        request = mock('request')
-        request.should_receive(:basic_auth).with('user', 'pass')
-        Net::HTTP::Delete.should_receive(:new).with('/member_entry.atom', an_instance_of(Hash)).and_return(request)
-
         http = mock('http')
-        http.should_receive(:request).with(request).and_return(response)
+        http.should_receive(:request) do |request|
+          request['Authorization'].should match(/^AuthHMAC access_id:[a-zA-Z0-9\/+]+=*$/)
+          response
+        end
+        
         Net::HTTP.should_receive(:start).with('example.org', 80).and_yield(http)
 
-        entry.destroy!(:user =&gt; 'user', :pass =&gt; 'pass')
+        entry.destroy!(:hmac_access_id =&gt; 'access_id', :hmac_secret_key =&gt; 'secret')
       end
+    end
     
     it &quot;should raise exception on save! without an edit link&quot; do
       entry = Atom::Entry.load_entry(File.open('spec/fixtures/entry.atom'))</diff>
      <filename>spec/atom/pub_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -143,9 +143,6 @@ describe Atom do
 
       lambda { Atom::Feed.load_feed(uri, :user =&gt; 'user', :pass =&gt; 'pass') }.should_not raise_error
     end
-    
-    it &quot;should pass basic-auth credentials on the request&quot; do
-    end
   end
   
   describe 'Atom::Entry.load_entry' do</diff>
      <filename>spec/atom_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3f43294fbbd47f28beb0ad980ae3f04fa21dfed2</id>
    </parent>
  </parents>
  <author>
    <name>Sean Geoghegan</name>
    <email>seangeo@gmail.com</email>
  </author>
  <url>http://github.com/seangeo/ratom/commit/b234d97c4e00e6ff87b7d0caa5fdb4c7cf54cc5c</url>
  <id>b234d97c4e00e6ff87b7d0caa5fdb4c7cf54cc5c</id>
  <committed-date>2008-08-04T22:44:35-07:00</committed-date>
  <authored-date>2008-08-04T22:38:37-07:00</authored-date>
  <message>Added AuthHMAC support</message>
  <tree>2be04a7b043910027906aa7566615d9a4ec327bc</tree>
  <committer>
    <name>Sean Geoghegan</name>
    <email>seangeo@gmail.com</email>
  </committer>
</commit>
