Permalink
Browse files

deprecate Basic auth

  • Loading branch information...
1 parent b87dc2d commit 878c09527037ab8ec5ac11a48afece61f03861e1 @pengwynn pengwynn committed May 26, 2010
Showing with 12 additions and 0 deletions.
  1. +1 −0 Rakefile
  2. +10 −0 lib/twitter/httpauth.rb
  3. +1 −0 test/test_helper.rb
View
@@ -18,6 +18,7 @@ Jeweler::Tasks.new do |gem|
gem.add_development_dependency("jnunemaker-matchy", "~> 0.4.0")
gem.add_development_dependency("mocha", "~> 0.9.0")
gem.add_development_dependency("fakeweb", "~> 1.2.0")
+ gem.add_development_dependency("redgreen", "~> 1.2.2")
end
Jeweler::GemcutterTasks.new
@@ -7,25 +7,35 @@ class HTTPAuth
attr_reader :username, :password, :options
def initialize(username, password, options={})
+ warn "[DEPRECATION] Baic auth is deprecated as Twitter is ending support in June 2010. Please migrate to OAuth."
@Omnipresent
Omnipresent May 26, 2010

Basic not Baic :)

+
@username, @password = username, password
@options = {:ssl => false}.merge(options)
options[:api_endpoint] ||= "api.twitter.com"
self.class.base_uri "http#{'s' if options[:ssl]}://#{options[:api_endpoint]}"
end
def get(uri, headers={})
+ warn "[DEPRECATION] Baic auth is deprecated as Twitter is ending support in June 2010. Please migrate to OAuth."
+
self.class.get(uri, :headers => headers, :basic_auth => basic_auth)
end
def post(uri, body={}, headers={})
+ warn "[DEPRECATION] Baic auth is deprecated as Twitter is ending support in June 2010. Please migrate to OAuth."
+
self.class.post(uri, :body => body, :headers => headers, :basic_auth => basic_auth)
end
def put(uri, body={}, headers={})
+ warn "[DEPRECATION] Baic auth is deprecated as Twitter is ending support in June 2010. Please migrate to OAuth."
+
self.class.put(uri, :body => body, :headers => headers, :basic_auth => basic_auth)
end
def delete(uri, body={}, headers={})
+ warn "[DEPRECATION] Baic auth is deprecated as Twitter is ending support in June 2010. Please migrate to OAuth."
+
self.class.delete(uri, :body => body, :headers => headers, :basic_auth => basic_auth)
end
View
@@ -4,6 +4,7 @@
require "matchy"
require "mocha"
require "fakeweb"
+require "redgreen"
FakeWeb.allow_net_connect = false

1 comment on commit 878c095

@pengwynn
Collaborator

Ha! Need a test for that I suppose. I'll fix up.

Please sign in to comment.