<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">15214</assigned-user-id>
  <attachments-count type="integer">0</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-04-30T11:15:18-07:00</created-at>
  <creator-id type="integer">7654</creator-id>
  <milestone-due-on type="datetime">2012-12-31T00:00:00-08:00</milestone-due-on>
  <milestone-id type="integer">27724</milestone-id>
  <number type="integer">16</number>
  <permalink>patch-http-authentication</permalink>
  <priority type="integer">26</priority>
  <project-id type="integer">9779</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>auth http patch</tag>
  <title>Offical HTTP Authentication Extensions</title>
  <updated-at type="datetime">2009-12-12T16:30:14-08:00</updated-at>
  <user-id type="integer">17123</user-id>
  <user-name>Ryan Tomayko</user-name>
  <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
  <assigned-user-name>Blake Mizerany</assigned-user-name>
  <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
  <milestone-title>Future</milestone-title>
  <original-body>I needed HTTP auth for a simple web service I was creating, so I ported some code over from Rails. I guess this could be useful for others as well? :)

Code: http://github.com/Chrononaut/sinatra/commits/master</original-body>
  <latest-body>I needed HTTP auth for a simple web service I was creating, so I ported some code over from Rails. I guess this could be useful for others as well? :)

Code: http://github.com/Chrononaut/sinatra/commits/master</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
I needed HTTP auth for a simple web service I was creating, so I ported some code over from Rails. I guess this could be useful for others as well? :)
&lt;/p&gt;&lt;p&gt;
Code: &lt;a href=&quot;http://github.com/Chrononaut/sinatra/commits/master&quot;&gt;http://github.com/Chrononaut/sin...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I needed HTTP auth for a simple web service I was creating, so I ported some code over from Rails. I guess this could be useful for others as well? :)

Code: http://github.com/Chrononaut/sinatra/commits/master</body>
      <body-html>&lt;div&gt;&lt;p&gt;
I needed HTTP auth for a simple web service I was creating, so I ported some code over from Rails. I guess this could be useful for others as well? :)
&lt;/p&gt;&lt;p&gt;
Code: &lt;a href=&quot;http://github.com/Chrononaut/sinatra/commits/master&quot;&gt;http://github.com/Chrononaut/sin...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-30T11:15:18-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-04-30T11:15:18-07:00</updated-at>
      <user-id type="integer">7654</user-id>
      <user-name>Bj&#248;rn Arild M&#230;land</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>oh snap.  nice. thank you. I'll get this in a soon as I can.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
oh snap.  nice. thank you. I'll get this in a soon as I can.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-30T11:36:13-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-04-30T11:36:13-07:00</updated-at>
      <user-id type="integer">15214</user-id>
      <user-name>Blake Mizerany</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Wow. This is a lot more simple than I thought it would be. Good stuff, Chrononaut. Here's some food for thought:

It might be worth investigating the use of &lt;a href=&quot;http://rack.rubyforge.org/doc/classes/Rack/Auth/Basic/Request.html&quot;&gt;Rack::Auth::Basic::Request&lt;/a&gt;. It's not well documented so it might be best to dive into the Rack sources: here's &lt;a href=&quot;http://github.com/chneukirchen/rack-mirror/tree/master/lib/rack/auth&quot;&gt;a link to lib/rack/auth&lt;/a&gt; on Rack's master. There's quite a bit of good, solid functionality in there.

All you need to use it is to pass the Rack environment hash into a new Rack::Auth::Basic::Request object. From there, you have access to a few useful convenience methods:

@@@ ruby
auth = Rack::Auth::Basic::Request.new(@env)
auth.provided? #=&gt; true when authentication headers present
auth.basic? #=&gt; true when authentication type is basic
auth.credentials #=&gt; [ 'username', 'password' ]
auth.username #=&gt; 'username'
@@@

Like I said, the implementation you've come up with is quite simple so using the Rack APIs isn't really buying much in this case. However, it's always a good idea to use what Rack gives us when possible, IMO.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Wow. This is a lot more simple than I thought it would be. Good stuff, Chrononaut. Here's some food for thought:
&lt;/p&gt;&lt;p&gt;
It might be worth investigating the use of &lt;a href=&quot;http://rack.rubyforge.org/doc/classes/Rack/Auth/Basic/Request.html&quot;&gt;Rack::Auth::Basic::Request&lt;/a&gt;. It's not well documented so it might be best to dive into the Rack sources: here's &lt;a href=&quot;http://github.com/chneukirchen/rack-mirror/tree/master/lib/rack/auth&quot;&gt;a link to lib/rack/auth&lt;/a&gt; on Rack's master. There's quite a bit of good, solid functionality in there.
&lt;/p&gt;&lt;p&gt;
All you need to use it is to pass the Rack environment hash into a new Rack::Auth::Basic::Request object. From there, you have access to a few useful convenience methods:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;auth = Rack::Auth::Basic::Request.new(@env)
auth.provided? #=&amp;gt; true when authentication headers present
auth.basic? #=&amp;gt; true when authentication type is basic
auth.credentials #=&amp;gt; [ 'username', 'password' ]
auth.username #=&amp;gt; 'username'&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Like I said, the implementation you've come up with is quite simple so using the Rack APIs isn't really buying much in this case. However, it's always a good idea to use what Rack gives us when possible, IMO.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-02T15:13:23-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-02T15:13:23-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>One thing that worries me a bit about this patch is that it adds some fairly generic method names to EventContext: #authenticate, #authorization, #username_and_password, #decode_credentials, etc. Seems like there's a good chance these are going to clash with app-specific helper methods or future authentication related code. I suppose we can deal with the latter when it comes up but the former seems worth preventing.

For example, suppose someone has implemented form/session-based auth using a helper method named &quot;authenticate&quot;:

@@@ ruby
helpers do
  def authenticate
    if session[:user].nil?
      ...
    end
  end
end

get '/admin' do
  authenticate
  ...
end
@@@

Wouldn't this cause problems? Seems like this type of thing could be avoided with some simple method renaming or pulling the code from within those methods up into the very-specifically named public methods.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
One thing that worries me a bit about this patch is that it adds some fairly generic method names to EventContext: #authenticate, #authorization, #username_and_password, #decode_credentials, etc. Seems like there's a good chance these are going to clash with app-specific helper methods or future authentication related code. I suppose we can deal with the latter when it comes up but the former seems worth preventing.
&lt;/p&gt;&lt;p&gt;
For example, suppose someone has implemented form/session-based auth using a helper method named &quot;authenticate&quot;:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;helpers do
  def authenticate
    if session[:user].nil?
      ...
    end
  end
end

get '/admin' do
  authenticate
  ...
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Wouldn't this cause problems? Seems like this type of thing could be avoided with some simple method renaming or pulling the code from within those methods up into the very-specifically named public methods.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-02T15:39:52-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-02T15:39:52-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Thanks for your feedback Ryan! Yes, I suspected Rack might have utility methods for this, but as you said the implementation turned out okay without them, so I didn't investigate further at that point. I agree with your view on using the Rack API as much as possible though, so I'll try to make them to use.

On your second point: Rails solves this by placing the public and private methods into two separate modules, and only includes the public one into ActionController. I had something in mind here - I just forgot to do it. I'll fix this right now.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Thanks for your feedback Ryan! Yes, I suspected Rack might have utility methods for this, but as you said the implementation turned out okay without them, so I didn't investigate further at that point. I agree with your view on using the Rack API as much as possible though, so I'll try to make them to use.
&lt;/p&gt;&lt;p&gt;
On your second point: Rails solves this by placing the public and private methods into two separate modules, and only includes the public one into ActionController. I had something in mind here - I just forgot to do it. I'll fix this right now.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-03T02:48:43-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-03T02:48:43-07:00</updated-at>
      <user-id type="integer">7654</user-id>
      <user-name>Bj&#248;rn Arild M&#230;land</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Rack::Auth::Basic::Request made the implementation a whole lot cleaner. :) I suspect this could be taken even further, by utilizing Rack::Auth::Basic.new(app) during the application build. I think it will require storing the login procedure and realm name in Sinatra.options (or similar) though. I dropped it for now since I'm not sure if it's worth it.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Rack::Auth::Basic::Request made the implementation a whole lot cleaner. :) I suspect this could be taken even further, by utilizing Rack::Auth::Basic.new(app) during the application build. I think it will require storing the login procedure and realm name in Sinatra.options (or similar) though. I dropped it for now since I'm not sure if it's worth it.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-03T07:20:24-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-03T07:20:24-07:00</updated-at>
      <user-id type="integer">7654</user-id>
      <user-name>Bj&#248;rn Arild M&#230;land</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Awesome.

Regarding Rack::Auth::Basic -- we'll be able to do this very easily once we get our pseudo builder support in. You'll be able to do something like the following right at the top-level of your sinatra file to get basic auth for the entire app:

@@@ ruby
use Rack::Auth::Basic do |username,password|
  password == 'secret'
end
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Awesome.
&lt;/p&gt;&lt;p&gt;
Regarding Rack::Auth::Basic -- we'll be able to do this very easily once we get our pseudo builder support in. You'll be able to do something like the following right at the top-level of your sinatra file to get basic auth for the entire app:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;use Rack::Auth::Basic do |username,password|
  password == 'secret'
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-03T13:04:05-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-03T13:04:05-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Just wondering if there's anything else missing before this can be pulled upstream?</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Just wondering if there's anything else missing before this can be pulled upstream?
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-12T03:12:07-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-12T03:12:07-07:00</updated-at>
      <user-id type="integer">7654</user-id>
      <user-name>Bj&#248;rn Arild M&#230;land</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Chrononaut,

My free time. ;) I'm wrapping a project at work and will pull soon. Thank you for your work!</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Chrononaut,
&lt;/p&gt;&lt;p&gt;
My free time. ;) I'm wrapping a project at work and will pull soon. Thank you for your work!
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-12T12:02:18-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-12T12:02:18-07:00</updated-at>
      <user-id type="integer">15214</user-id>
      <user-name>Blake Mizerany</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Ah, no problem. :) Btw I tried to clean up the history by rebasing all the small commits into a large one, but I got into some trouble (my git-fu is not that strong). Maybe you can clean it up on your part when you pull. It's not a big deal of course.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Ah, no problem. :) Btw I tried to clean up the history by rebasing all the small commits into a large one, but I got into some trouble (my git-fu is not that strong). Maybe you can clean it up on your part when you pull. It's not a big deal of course.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-16T02:22:32-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-05-16T02:22:32-07:00</updated-at>
      <user-id type="integer">7654</user-id>
      <user-name>Bj&#248;rn Arild M&#230;land</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-07T18:29:13-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: 
:assigned_user: 15214
</diffable-attributes>
      <milestone-id type="integer">9332</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-09-07T18:29:18-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.3.0 Sammy</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Pushing to 0.4. I'd like to keep new features in 0.3.x to a minimum so that we're not burdening 0.4 with even more work for backward compatibility.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Pushing to 0.4. I'd like to keep new features in 0.3.x to a
minimum so that we're not burdening 0.4 with even more work for
backward compatibility.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-14T03:16:57-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 9332
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>open</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-09-14T03:17:56-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Sorry, moving to hoboken and putting on hold for now.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Sorry, moving to hoboken and putting on hold for now.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-12-30T02:45:16-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 18496
:state: open
</diffable-attributes>
      <milestone-id type="integer">27290</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>hold</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-12-30T02:45:17-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.0 Hoboken</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-30T03:00:27-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:state: hold
</diffable-attributes>
      <milestone-id type="integer">27290</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2008-12-30T03:00:30-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.0 Hoboken</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T11:10:43-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 27290
</diffable-attributes>
      <milestone-id type="integer">27725</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-07T11:10:47-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">17123</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-17T16:48:02-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 27725
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-17T16:48:04-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Ryan Tomayko</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-18T14:42:45-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 17123
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-18T14:42:50-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Here's an implementation by foca that looks pretty good as well:

http://github.com/foca/sinatra-diddies/blob/master/lib/diddies/authorization.rb

Also, I like &quot;authorize!&quot; as the helper method name. Not sure where I saw it but I've been meaning to note that.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Here's an implementation by foca that looks pretty good as
well:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/foca/sinatra-diddies/blob/master/lib/diddies/authorization.rb&quot;&gt;
http://github.com/foca/sinatra-d...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, I like &quot;authorize!&quot; as the helper method name. Not sure
where I saw it but I've been meaning to note that.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-25T00:15:50-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-25T00:15:53-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I'm not sure if this belongs in core. I'd like to keep it separate as a plugin. Keep the core lean and mean :)</body>
      <body-html>&lt;div&gt;&lt;p&gt;I'm not sure if this belongs in core. I'd like to keep it
separate as a plugin. Keep the core lean and mean :)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-25T13:01:56-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-25T13:02:01-08:00</updated-at>
      <user-id type="integer">278</user-id>
      <user-name>ronin-278 (at lighthouseapp)</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I'm definitely leaning toward keeping it out of core. It's not actually planned for a release but it seems to come up quite a bit in #sinatra. If we had a solid plugin/extension that we could point people to, I'd be willing to WONTFIX this.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I'm definitely leaning toward keeping it out of core. It's not
actually planned for a release but it seems to come up quite a bit
in #sinatra. If we had a solid plugin/extension that we could point
people to, I'd be willing to WONTFIX this.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-25T16:15:29-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-25T16:15:29-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>+1 for keeping it out of core, mainly because Rack gives us the functionality out of the box, as middleware:

@@@ ruby
use Rack::Auth::Basic do |username, password|
  username == 'foo' and password == 'bar'
end
@@@

Which covers all the cases where all of the app has to be password protected. I suspect you can check for the requested path or something to limit that.</body>
      <body-html>&lt;div&gt;&lt;p&gt;+1 for keeping it out of core, mainly because Rack gives us the
functionality out of the box, as middleware:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
use Rack::Auth::Basic do |username, password|
  username == 'foo' and password == 'bar'
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which covers all the cases where all of the app has to be
password protected. I suspect you can check for the requested path
or something to limit that.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-26T08:49:57-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-26T08:49:59-08:00</updated-at>
      <user-id type="integer">11278</user-id>
      <user-name>Harry Vangberg</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Harry: if it were that simple, I'd be in total agreement with you. The issue is that there's often a need to mark certain requests as requiring Auth and others not. Using the Rack::Auth::Basic middleware protects the entire app (or mapping area).</body>
      <body-html>&lt;div&gt;&lt;p&gt;Harry: if it were that simple, I'd be in total agreement with
you. The issue is that there's often a need to mark certain
requests as requiring Auth and others not. Using the
Rack::Auth::Basic middleware protects the entire app (or mapping
area).&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-26T11:04:33-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-01-26T11:04:36-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I've implemented an alternative way of specifying protected routes, which I think is a tad nicer than doing it in the block:

@@@ ruby
get '/sekret', :protect =&gt; 'admin:password' do
  # protected stuff goes here
end
@@@

It's in my fork here: http://github.com/nakajima/sinatra/tree/master.

With that being said, I'm perfectly fine with this type of stuff not being built into core as well.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I've implemented an alternative way of specifying protected
routes, which I think is a tad nicer than doing it in the
block:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
get '/sekret', :protect =&amp;gt; 'admin:password' do
  # protected stuff goes here
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's in my fork here: &lt;a href=&quot;http://github.com/nakajima/sinatra/tree/master.%3C/p&quot;&gt;http://github.com/nakajima/sinat...&lt;/a&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;With that being said, I'm perfectly fine with this type of stuff
not being built into core as well.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-08T01:40:58-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-02-08T01:40:59-08:00</updated-at>
      <user-id type="integer">5641</user-id>
      <user-name>Pat Nakajima</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Yeah. This is perfect for an extension. We should have docs on that shortly and I'm hoping a lot of these Auth experiments will make there way into extensions available as gems.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Yeah. This is perfect for an extension. We should have docs on
that shortly and I'm hoping a lot of these Auth experiments will
make there way into extensions available as gems.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-17T08:51:50-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-02-17T08:55:17-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-03-02T20:06:49-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 27724
</diffable-attributes>
      <milestone-id type="integer">31983</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-03-02T20:06:50-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>sounds more like a plugin/extension to me since basic auth requires a clear-text copy of the password, so sinatra'd be promoting what is in essence a bad practice

that said... if you do want to protect part of your application using Rack::Auth, you can always URLMap the secure and non-secure parts (and I know that doesn't take care of all cases)</body>
      <body-html>&lt;div&gt;&lt;p&gt;sounds more like a plugin/extension to me since basic auth
requires a clear-text copy of the password, so sinatra'd be
promoting what is in essence a bad practice&lt;/p&gt;
&lt;p&gt;that said... if you do want to protect part of your application
using Rack::Auth, you can always URLMap the secure and non-secure
parts (and I know that doesn't take care of all cases)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-03-03T09:47:19-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">31983</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-03-03T09:47:20-08:00</updated-at>
      <user-id type="integer">17559</user-id>
      <user-name>S. Brent Faulkner</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Yeah. I agree this should be an extension but I'd still like to keep it as a task for us to consider as part of the 0.9.2 release. IMO, it would be good to have a few extensions that we maintain so that we're putting the extensions API through its paces.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Yeah. I agree this should be an extension but I'd still like to
keep it as a task for us to consider as part of the 0.9.2 release.
IMO, it would be good to have a few extensions that we maintain so
that we're putting the extensions API through its paces.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-03-04T04:47:57-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">31983</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-03-04T04:47:58-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>One more solution to this: &lt;http://github.com/integrity/sinatra-authorization/tree/master&gt; (avalaible on rubyforge BTW)

Don't miss nakajima's nice sugar (not included in the gem ATM): &lt;http://github.com/integrity/sinatra-authorization/blob/c503ccd2a8e5bddc816cc3dc237e58534ac1217a/test/authorization_test.rb#L29&gt;</body>
      <body-html>&lt;div&gt;&lt;p&gt;One more solution to this: &lt;a href=&quot;http://github.com/integrity/sinatra-authorization/tree/master&quot;&gt;http://github.com/integrity/sinatra-authorization/tree/master&lt;/a&gt;
(avalaible on rubyforge BTW)&lt;/p&gt;
&lt;p&gt;Don't miss nakajima's nice sugar (not included in the gem ATM):
&lt;a href=&quot;http://github.com/integrity/sinatra-authorization/blob/c503ccd2a8e5bddc816cc3dc237e58534ac1217a/test/authorization_test.rb#L29&quot;&gt;
http://github.com/integrity/sinatra-authorization/blob/c503ccd2a8e5bddc816cc3dc237e58534ac1217a/test/authorization_test.rb#L29&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-03-31T10:11:38-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">31983</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-03-31T10:59:39-07:00</updated-at>
      <user-id type="integer">11306</user-id>
      <user-name>Simon Rozet</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>0.9.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Warden looks interesting as well:

http://github.com/hassox/warden/tree/master</body>
      <body-html>&lt;div&gt;&lt;p&gt;Warden looks interesting as well:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/hassox/warden/tree/master&quot;&gt;http://github.com/hassox/warden/...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-04-25T09:27:25-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 31983
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-04-25T09:27:28-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Eh, the fact that it's a bad idea to send password via clear text really has no bearing on whether it should be an extension or not.  There are plenty of uses for basic auth that don't involve sending passwords as clear text.  API keys and tokens, for example, are sometimes sent via basic auth.  Also, there's a few specs out and about that insist on basic auth as a minimum.  See, for example: http://bitworking.org/projects/atom/rfc5023.html#rfc.section.14

Basic auth should really be something we officially support.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Eh, the fact that it's a bad idea to send password via clear
text really has no bearing on whether it should be an extension or
not. There are plenty of uses for basic auth that don't involve
sending passwords as clear text. API keys and tokens, for example,
are sometimes sent via basic auth. Also, there's a few specs out
and about that insist on basic auth as a minimum. See, for example:
&lt;a href=&quot;http://bitworking.org/projects/atom/rfc5023.html#rfc&quot;&gt;http://bitworking.org/projects/a...&lt;/a&gt;.section.14&lt;/p&gt;
&lt;p&gt;Basic auth should really be something we officially support.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-05-01T08:01:14-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-05-01T08:01:19-07:00</updated-at>
      <user-id type="integer">9337</user-id>
      <user-name>Bob Aman</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>@Bob: I don't know. It's not something *every* app needs, and I like keeping he core lean and mean :)

We should, however, pick an extension that handles this and mark it as the &quot;preferred way&quot;. Even host it under github.com/sinatra to mark it as &quot;official&quot;, and test against it with new releases to ensure it works. Only you need to require another library to get this extra piece of functionality.

Now, which one we should choose, I don't know :)</body>
      <body-html>&lt;div&gt;&lt;p&gt;@Bob: I don't know. It's not something &lt;em&gt;every&lt;/em&gt; app needs,
and I like keeping he core lean and mean :)&lt;/p&gt;
&lt;p&gt;We should, however, pick an extension that handles this and mark
it as the &quot;preferred way&quot;. Even host it under github.com/sinatra to
mark it as &quot;official&quot;, and test against it with new releases to
ensure it works. Only you need to require another library to get
this extra piece of functionality.&lt;/p&gt;
&lt;p&gt;Now, which one we should choose, I don't know :)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-05-22T21:15:27-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-05-22T21:15:31-07:00</updated-at>
      <user-id type="integer">278</user-id>
      <user-name>ronin-278 (at lighthouseapp)</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Rereading what I wrote, yeah... I wasn't clear.  When I said &quot;officially support&quot; I didn't mean as part of the core.  Just that we should officially maintain something, somewhere that does HTTP auth.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Rereading what I wrote, yeah... I wasn't clear. When I said
&quot;officially support&quot; I didn't mean as part of the core. Just that
we should officially maintain something, somewhere that does HTTP
auth.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-05-22T21:53:26-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>[PATCH] HTTP Authentication</title>
      <updated-at type="datetime">2009-05-22T21:53:27-07:00</updated-at>
      <user-id type="integer">9337</user-id>
      <user-name>Bob Aman</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-05-25T05:04:33-07:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:title: &quot;[PATCH] HTTP Authentication&quot;
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>Offical HTTP Authentication Extensions</title>
      <updated-at type="datetime">2009-05-25T05:04:34-07:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Last I heard, Blake was working on something for this long standing ticket. Are there other HTTP auth extensions out there that are gaining good traction?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Last I heard, Blake was working on something for this long
standing ticket. Are there other HTTP auth extensions out there
that are gaining good traction?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-12-12T15:34:43-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>Offical HTTP Authentication Extensions</title>
      <updated-at type="datetime">2009-12-12T15:34:47-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I use http://github.com/integrity/sinatra-authorization/blob/master/lib/sinatra/authorization.rb which is actually based on some early code by you and cschneid but it is not actively maintained; I just noticed it is still using Sinatra::Default. I believe it could be good if someone gave it some love, though. It'd be a good use of the undocumented route-level filter feature. (`get &quot;/foo&quot;, :protect =&gt; true`) The &quot;playground&quot; branch has some cool stuff as well, like this commit by nakajima: http://github.com/integrity/sinatra-authorization/commit/f4afb20e2850c4200ebc6edef6b947b5f80558c4</body>
      <body-html>&lt;div&gt;&lt;p&gt;I use &lt;a href=
&quot;http://github.com/integrity/sinatra-authorization/blob/master/lib/sinatra/authorization.rb&quot;&gt;
http://github.com/integrity/sinatra-authorization/blob/master/lib/s...&lt;/a&gt;
which is actually based on some early code by you and cschneid but
it is not actively maintained; I just noticed it is still using
Sinatra::Default. I believe it could be good if someone gave it
some love, though. It'd be a good use of the undocumented
route-level filter feature. (&lt;code&gt;get &quot;/foo&quot;, :protect =&amp;gt;
true&lt;/code&gt;) The &quot;playground&quot; branch has some cool stuff as well,
like this commit by nakajima: &lt;a href=
&quot;http://github.com/integrity/sinatra-authorization/commit/f4afb20e2850c4200ebc6edef6b947b5f80558c4&quot;&gt;
http://github.com/integrity/sinatra-authorization/commit/f4afb20e28...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-12-12T15:57:11-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>new</state>
      <tag>auth http patch</tag>
      <title>Offical HTTP Authentication Extensions</title>
      <updated-at type="datetime">2009-12-12T15:57:12-08:00</updated-at>
      <user-id type="integer">11306</user-id>
      <user-name>Simon Rozet</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">15214</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>That looks great sr. Let's close this.</body>
      <body-html>&lt;div&gt;&lt;p&gt;That looks great sr. Let's close this.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-12-12T16:30:13-08:00</created-at>
      <creator-id type="integer">7654</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer">27724</milestone-id>
      <number type="integer">16</number>
      <permalink>patch-http-authentication</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">9779</project-id>
      <state>resolved</state>
      <tag>auth http patch</tag>
      <title>Offical HTTP Authentication Extensions</title>
      <updated-at type="datetime">2009-12-12T16:30:14-08:00</updated-at>
      <user-id type="integer">17123</user-id>
      <user-name>Ryan Tomayko</user-name>
      <creator-name>Bj&#248;rn Arild M&#230;land</creator-name>
      <assigned-user-name>Blake Mizerany</assigned-user-name>
      <url>http://sinatra.lighthouseapp.com/projects/9779/tickets/16</url>
      <milestone-title>Future</milestone-title>
    </version>
  </versions>
</ticket>
