Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jun 27, 2011
1 parent fe63cbb commit 24cc19f
Show file tree
Hide file tree
Showing 35 changed files with 30 additions and 79 deletions.
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/evernote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def user_info

def user_data
@user_data ||= begin
user_store_url = consumer.site + '/edam/user'
user_store_url = 'https://www.evernote.com/edam/user'
client = ::Evernote::Client.new(::Evernote::EDAM::UserStore::UserStore::Client, user_store_url, {})
client.getUser(@access_token.token)
end
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module Strategies
class Google < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
}
google_contacts_auth = "www.google.com/m8/feeds"
options[:scope] ||= "http://#{google_contacts_auth}"
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/google_health.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module Strategies
class GoogleHealth < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
}

super(app, :google_health, consumer_key, consumer_secret, client_options, options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module Strategies
class GoogleHealthSandbox < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
}

super(app, :google_health_sandbox, consumer_key, consumer_secret, client_options, options)
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/hyves.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
:authorize_url => 'http://www.hyves.nl/api/authorize',
:token_url => token_url,
:http_method => :get,
:scheme => :header
:scheme => :header,
}
super(app, :hyves, consumer_key, consumer_secret, client_options, options, &block)
end
Expand Down
10 changes: 5 additions & 5 deletions oa-oauth/lib/omniauth/strategies/oauth/identica.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ module Strategies
#
class Identica < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
super(app, :identica, consumer_key, consumer_secret,
{
:token_url => 'http://identi.ca/api/oauth/access_token',
:authorize_url => 'http://identi.ca/api/oauth/authorize',
}, options, &block)
client_options = {
:authorize_url => 'http://identi.ca/api/oauth/authorize',
:token_url => 'http://identi.ca/api/oauth/access_token',
}
super(app, :identica, consumer_key, consumer_secret, client_options, options, &block)
end

def auth_hash
Expand Down
2 changes: 0 additions & 2 deletions oa-oauth/lib/omniauth/strategies/oauth/linked_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
:authorize_url => 'https://api.linkedin.com/uas/oauth/authorize',
:token_url => 'https://api.linkedin.com/uas/oauth/accessToken',
}

client_options[:authorize_url] = '/uas/oauth/authenticate' unless options[:sign_in] == false

super(app, :linked_in, consumer_key, consumer_secret, client_options, options, &block)
end

Expand Down
13 changes: 6 additions & 7 deletions oa-oauth/lib/omniauth/strategies/oauth/meetup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ class Meetup < OmniAuth::Strategies::OAuth
# @param [String] consumer_secret the application consumer secret
# @option options [Boolean, true] :sign_in When true, use a sign-in flow instead of the authorization flow.
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
auth_path = (options[:sign_in] == false) ? 'http://www.meetup.com/authorize' : 'http://www.meetup.com/authenticate'

super(app, :meetup, consumer_key, consumer_secret,
{
:token_url => 'https://api.meetup.com/oauth/access',
:authorize_url => auth_path,
}, options)
authorize_url = (options[:sign_in] == false) ? 'http://www.meetup.com/authorize' : 'http://www.meetup.com/authenticate'
client_options = {
:authorize_url => authorize_url,
:token_url => 'https://api.meetup.com/oauth/access',
}
super(app, :meetup, consumer_key, consumer_secret, client_options, options)
end

def auth_hash
Expand Down
5 changes: 4 additions & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/miso.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ module Strategies
#
class Miso < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
super(app, :miso, consumer_key, consumer_secret, {:site => 'https://gomiso.com'}, options)
client_options = {
:site => 'https://gomiso.com',
}
super(app, :miso, consumer_key, consumer_secret, client_options, options)
end

def auth_hash
Expand Down
6 changes: 3 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/netflix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module Strategies
#
class Netflix < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
opts = {
:token_url => 'http://api.netflix.com/oauth/access_token',
client_options = {
:authorize_url => 'https://api-user.netflix.com/oauth/login',
:token_url => 'http://api.netflix.com/oauth/access_token',
}
super(app, :netflix, consumer_key, consumer_secret, opts, options, &block)
super(app, :netflix, consumer_key, consumer_secret, client_options, options, &block)
end

def request_phase
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/plurk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Plurk < OmniAuth::Strategies::OAuth
# @param [String] consumer_secret App secret registered on plurk
def initialize(app, consumer_key=nil, consumer_secret=nil, options = {}, &block)
client_options = {
:token_url => 'http://www.plurk.com/OAuth/access_token',
:authorize_url => 'http://www.plurk.com/OAuth/authorize',
:token_url => 'http://www.plurk.com/OAuth/access_token',
}
super(app, :plurk, consumer_key, consumer_secret, client_options, options)
end
Expand Down
4 changes: 2 additions & 2 deletions oa-oauth/lib/omniauth/strategies/oauth/rdio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module Strategies
#
class Rdio < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
opts = {
client_options = {
:token_url => 'http://api.rdio.com/oauth/access_token',
:authorize_url => 'https://www.rdio.com/oauth/authorize',
}
super(app, :rdio, consumer_key, consumer_secret, opts, options, &block)
super(app, :rdio, consumer_key, consumer_secret, client_options, options, &block)
end

def auth_hash
Expand Down
4 changes: 0 additions & 4 deletions oa-oauth/lib/omniauth/strategies/oauth/sound_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@

module OmniAuth
module Strategies
#
# Authenticate to SoundCloud via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::SoundCloud, 'consumerkey', 'consumersecret'
#

class SoundCloud < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
4 changes: 0 additions & 4 deletions oa-oauth/lib/omniauth/strategies/oauth/t163.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

module OmniAuth
module Strategies
#
# Authenticate to T163 via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::T163, 'APIKey', 'APIKeySecret'
#
class T163 < OmniAuth::Strategies::OAuth

def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
@api_key = consumer_key
client_options = {
Expand Down
4 changes: 0 additions & 4 deletions oa-oauth/lib/omniauth/strategies/oauth/tqq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

module OmniAuth
module Strategies
#
# Authenticate to Tqq via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Tqq, 'APIKey', 'APIKeySecret'
#
class Tqq < OmniAuth::Strategies::OAuth

def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
@api_key = consumer_key
client_options = {
Expand Down
2 changes: 0 additions & 2 deletions oa-oauth/lib/omniauth/strategies/oauth/trade_me.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

module OmniAuth
module Strategies
#
# Authenticate to TradeMe via OAuth and retrieve basic user information.
# Usage:
# use OmniAuth::Strategies::TradeMe, 'consumerkey', 'consumersecret'
#
class TradeMe < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/trip_it.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

module OmniAuth
module Strategies
#
# Authenticate to TripIt via OAuth and retrieve an access token for API usage
#
# Usage:
#
# use OmniAuth::Strategies::TripIt, 'consumerkey', 'consumersecret'
#
class TripIt < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/tsina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@

module OmniAuth
module Strategies
#
# Authenticate to TSina via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::TSina, 'APIKey', 'APIKeySecret'
#
class Tsina < OmniAuth::Strategies::OAuth

def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/tsohu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@

module OmniAuth
module Strategies
#
# Authenticate to Tsohu via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Tsohu, 'APIKey', 'APIKeySecret'
#
class Tsohu < OmniAuth::Strategies::OAuth

def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
Expand Down
2 changes: 0 additions & 2 deletions oa-oauth/lib/omniauth/strategies/oauth/tumblr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

module OmniAuth
module Strategies
#
# Authenticate to Tumblr via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Tumblr, 'consumerkey', 'consumersecret'
#
class Tumblr < OmniAuth::Strategies::OAuth
# Initialize the middleware
#
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

module OmniAuth
module Strategies
#
# Authenticate to Twitter via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Twitter, 'consumerkey', 'consumersecret'
#
class Twitter < OmniAuth::Strategies::OAuth
# Initialize the middleware
#
Expand All @@ -19,7 +17,6 @@ def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
:site => 'https://api.twitter.com',
}

options[:authorize_params] = {:force_login => 'true'} if options.delete(:force_login) == true
client_options[:authorize_path] = '/oauth/authenticate' unless options[:sign_in] == false
super(app, :twitter, consumer_key, consumer_secret, client_options, options)
Expand Down
4 changes: 0 additions & 4 deletions oa-oauth/lib/omniauth/strategies/oauth/type_pad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

module OmniAuth
module Strategies
#
# Authenticate to Typepad via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Typepad, 'consumerkey', 'consumersecret', :application_id => 'my_type_pad_application_id'
#
# application_id is required.
#
class TypePad < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
# TypePad uses the application ID for one of the OAuth paths.
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/vimeo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@

module OmniAuth
module Strategies
#
# Authenticate to Vimeo via OAuth and retrieve basic user information.
#
# Usage:
#
# use OmniAuth::Strategies::Vimeo, 'consumerkey', 'consumersecret'
#
class Vimeo < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/yahoo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@

module OmniAuth
module Strategies
#
# Authenticate to Yahoo via OAuth and retrieve basic
# user information.
#
# Usage:
#
# use OmniAuth::Strategies::Yahoo, 'consumerkey', 'consumersecret'
#
class Yahoo < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
1 change: 0 additions & 1 deletion oa-oauth/lib/omniauth/strategies/oauth/yammer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
:authorize_url => 'https://www.yammer.com/oauth/authorize',
:token_url => 'https://www.yammer.com/oauth/access_token',
}

super(app, :yammer, consumer_key, consumer_secret, client_options, options)
end

Expand Down
3 changes: 0 additions & 3 deletions oa-oauth/lib/omniauth/strategies/oauth/you_tube.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

module OmniAuth
module Strategies
#
# Authenticate to YouTube via OAuth and retrieve basic user info.
#
# Usage:
#
# use OmniAuth::Strategies::YouTube, 'consumerkey', 'consumersecret'
#
class YouTube < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
client_options = {
Expand Down
1 change: 0 additions & 1 deletion oa-oauth/lib/omniauth/strategies/oauth2/bitly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module OmniAuth
module Strategies
#
# Authenticate to Bitly utilizing OAuth 2.0 and retrieve
# basic user information.
#
Expand Down
1 change: 0 additions & 1 deletion oa-oauth/lib/omniauth/strategies/oauth2/dailymile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module OmniAuth
module Strategies
#
# Authenticate to DailyMile utilizing OAuth 2.0 and retrieve
# basic user information.
#
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth2/doit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(app, client_id=nil, client_secret=nil, options={}, &block)
protected

def user_data
@data ||= MultiJson.decode(@access_token.get(client.site+"/v1/settings"),{'Authorization'=> 'OAuth'+@access_token.token})
@data ||= MultiJson.decode(@access_token.get('https://openapi.doit.im/v1/settings'), {'Authorization' => 'OAuth' + @access_token.token})
end

def request_phase
Expand Down
2 changes: 1 addition & 1 deletion oa-oauth/lib/omniauth/strategies/oauth2/foursquare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(app, client_id=nil, client_secret=nil, options={}, &block)
options[:sign_in] ||= true
client_options = {
:authorize_url => authorize_url(options),
:token_url => 'https://foursquare.com/oauth2/access_token'
:token_url => 'https://foursquare.com/oauth2/access_token',
}
super(app, :foursquare, client_id, client_secret, client_options, options, &block)
end
Expand Down
Loading

0 comments on commit 24cc19f

Please sign in to comment.