Skip to content

Commit

Permalink
deprecate Basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
pengwynn committed May 26, 2010
1 parent b87dc2d commit 878c095
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions lib/twitter/httpauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."

This comment has been minimized.

Copy link
@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

Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require "matchy"
require "mocha"
require "fakeweb"
require "redgreen"

FakeWeb.allow_net_connect = false

Expand Down

1 comment on commit 878c095

@pengwynn
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.