From 9c767e455aeecb78222034efcc8c57f605c60e9b Mon Sep 17 00:00:00 2001 From: "James A. Rosen" Date: Wed, 21 Jul 2010 16:27:56 -0700 Subject: [PATCH] removed oa-basic 0.0.3 distribution, which should have been ignored --- oa-basic/dist/oa-basic-0.0.3/CHANGELOG.rdoc | 3 - oa-basic/dist/oa-basic-0.0.3/LICENSE.rdoc | 0 oa-basic/dist/oa-basic-0.0.3/README.rdoc | 34 ----------- .../dist/oa-basic-0.0.3/lib/omniauth/basic.rb | 10 ---- .../lib/omniauth/strategies/gowalla.rb | 19 ------- .../lib/omniauth/strategies/http_basic.rb | 56 ------------------- 6 files changed, 122 deletions(-) delete mode 100644 oa-basic/dist/oa-basic-0.0.3/CHANGELOG.rdoc delete mode 100644 oa-basic/dist/oa-basic-0.0.3/LICENSE.rdoc delete mode 100644 oa-basic/dist/oa-basic-0.0.3/README.rdoc delete mode 100644 oa-basic/dist/oa-basic-0.0.3/lib/omniauth/basic.rb delete mode 100644 oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/gowalla.rb delete mode 100644 oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/http_basic.rb diff --git a/oa-basic/dist/oa-basic-0.0.3/CHANGELOG.rdoc b/oa-basic/dist/oa-basic-0.0.3/CHANGELOG.rdoc deleted file mode 100644 index 718b0dcff..000000000 --- a/oa-basic/dist/oa-basic-0.0.3/CHANGELOG.rdoc +++ /dev/null @@ -1,3 +0,0 @@ -== 0.0.3 - -* First working release, Campfire and Basecamp support \ No newline at end of file diff --git a/oa-basic/dist/oa-basic-0.0.3/LICENSE.rdoc b/oa-basic/dist/oa-basic-0.0.3/LICENSE.rdoc deleted file mode 100644 index e69de29bb..000000000 diff --git a/oa-basic/dist/oa-basic-0.0.3/README.rdoc b/oa-basic/dist/oa-basic-0.0.3/README.rdoc deleted file mode 100644 index 729b577da..000000000 --- a/oa-basic/dist/oa-basic-0.0.3/README.rdoc +++ /dev/null @@ -1,34 +0,0 @@ -= OmniAuth::Basic - -OmniAuth stratgies for APIs that have HTTP Basic authentication (such as Campfire and Basecamp). - -== Installation - -To get just HTTP Basic functionality: - - gem install oa-basic - -For the full auth suite: - - gem install omniauth - -== Stand-Alone Example - -Use the strategy as a middleware in your application: - - require 'omniauth/basic' - - use OmniAuth::Strategies::Campfire - -Then simply direct users to '/auth/campfire' to prompt them for their Campfire credentials. You may also pre-set the credentials by POSTing to the URL with appropriate parameters (in the case of Campfire and Basecamp, the parameters are subdomain, user, and password). - -== OmniAuth Builder - -If you want to allow multiple providers, use the OmniAuth Builder: - - require 'omniauth/basic' - - use OmniAuth::Builder do - provider :campfire - provider :basecamp - end diff --git a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/basic.rb b/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/basic.rb deleted file mode 100644 index 5b250062b..000000000 --- a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/basic.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'omniauth/core' - -module OmniAuth - module Strategies - autoload :HttpBasic, 'omniauth/strategies/http_basic' - autoload :Basecamp, 'omniauth/strategies/basecamp' - autoload :Campfire, 'omniauth/strategies/campfire' - # autoload :Gowalla, 'omniauth/strategies/gowalla' - end -end diff --git a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/gowalla.rb b/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/gowalla.rb deleted file mode 100644 index bf8561244..000000000 --- a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/gowalla.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Gowalla's API isn't authenticated yet -# so this won't actually work at all it -# turns out. - -# require 'omniauth/basic' -# -# module OmniAuth -# module Strategies -# class Gowalla < OmniAuth::Strategies::HttpBasic #:nodoc: -# def initialize(app, api_key) -# super(app, :gowalla, nil, {'X-Gowalla-API-Key' => api_key, 'Accept' => 'application/json'}) -# end -# -# def endpoint -# "http://#{request[:username]}:#{request[:password]}@api.gowalla.com/users/#{request[:username]}" -# end -# end -# end -# end diff --git a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/http_basic.rb b/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/http_basic.rb deleted file mode 100644 index d079d2a7f..000000000 --- a/oa-basic/dist/oa-basic-0.0.3/lib/omniauth/strategies/http_basic.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'restclient' -require 'omniauth/basic' - -module OmniAuth - module Strategies - class HttpBasic - include OmniAuth::Strategy - - def initialize(app, name, endpoint, headers = {}) - super - @endpoint = endpoint - @request_headers = headers - end - - attr_reader :endpoint, :request_headers - - def request_phase - if env['REQUEST_METHOD'] == 'GET' - get_credentials - else - perform - end - end - - def title - name.split('_').map{|s| s.capitalize}.join(' ') - end - - def get_credentials - OmniAuth::Form.build(title) do - text_field 'Username', 'username' - password_field 'Password', 'password' - end.to_response - end - - def perform - @response = perform_authentication(endpoint) - request.POST['auth'] = auth_hash - @env['REQUEST_METHOD'] = 'GET' - @env['PATH_INFO'] = "#{OmniAuth.config.path_prefix}/#{name}/callback" - - @app.call(@env) - rescue RestClient::Request::Unauthorized - fail!(:invalid_credentials) - end - - def perform_authentication(uri, headers = request_headers) - RestClient.get(uri, headers) - end - - def callback_phase - fail!(:invalid_credentials) - end - end - end -end