warden-github 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,9 +2,9 @@ module Warden
2
2
  module Github
3
3
  module Oauth
4
4
  class Proxy
5
- attr_accessor :client_id, :secret, :scopes, :callback_url
6
- def initialize(client_id, secret, scopes, callback_url)
7
- @client_id, @secret, @scopes, @callback_url = client_id, secret, scopes, callback_url
5
+ attr_accessor :client_id, :secret, :scopes, :oauth_domain, :callback_url
6
+ def initialize(client_id, secret, scopes, oauth_domain, callback_url)
7
+ @client_id, @secret, @scopes, @oauth_domain, @callback_url = client_id, secret, scopes, oauth_domain, callback_url
8
8
  end
9
9
 
10
10
  def ssl_options
@@ -19,7 +19,7 @@ module Warden
19
19
  def client
20
20
  @client ||= OAuth2::Client.new(@client_id, @secret,
21
21
  :ssl => ssl_options,
22
- :site => 'https://github.com',
22
+ :site => oauth_domain,
23
23
  :token_url => '/login/oauth/access_token',
24
24
  :authorize_url => '/login/oauth/authorize')
25
25
  end
@@ -43,6 +43,7 @@ Warden::Strategies.add(:github) do
43
43
  @oauth_proxy ||= Warden::Github::Oauth::Proxy.new(env['warden'].config[:github_client_id],
44
44
  env['warden'].config[:github_secret],
45
45
  env['warden'].config[:github_scopes],
46
+ env['warden'].config[:github_oauth_domain],
46
47
  callback_url)
47
48
  end
48
49
 
@@ -1,5 +1,5 @@
1
1
  module Warden
2
2
  module Github
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
data/spec/app.rb CHANGED
@@ -14,6 +14,7 @@ module Example
14
14
  manager[:github_secret] = ENV['GITHUB_CLIENT_SECRET'] || 'ed8ff0c54067aefb808dab1ca265865405d08d6f'
15
15
 
16
16
  manager[:github_scopes] = ''
17
+ manager[:github_oauth_domain] = ENV['GITHUB_OAUTH_DOMAIN'] || 'https://github.com'
17
18
  manager[:github_callback_url] = '/auth/github/callback'
18
19
  end
19
20
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-github
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 1
10
- version: 0.3.1
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Corey Donohoe
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-21 00:00:00 -08:00
18
+ date: 2012-03-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency