warden-github 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,9 @@ module Warden
2
2
  module Github
3
3
  module Oauth
4
4
  class Proxy
5
- def initialize(client_id, secret, callback_url)
6
- @client_id, @secret, @callback_url = client_id, secret, callback_url
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
7
8
  end
8
9
 
9
10
  def client
@@ -14,13 +15,13 @@ module Warden
14
15
  end
15
16
 
16
17
  def access_token_for(code)
17
- web_server.get_access_token(code, :redirect_uri => @callback_url)
18
+ web_server.get_access_token(code, :redirect_uri => callback_url)
18
19
  end
19
20
 
20
21
  def authorize_url
21
22
  web_server.authorize_url(
22
- :scope => 'email,offline_access',
23
- :redirect_uri => @callback_url
23
+ :scope => scopes,
24
+ :redirect_uri => callback_url
24
25
  )
25
26
  end
26
27
 
@@ -36,6 +36,7 @@ Warden::Strategies.add(:github) do
36
36
  def oauth_proxy
37
37
  @oauth_proxy ||= Warden::Github::Oauth::Proxy.new(env['warden'].config[:github_client_id],
38
38
  env['warden'].config[:github_secret],
39
+ env['warden'].config[:github_scopes],
39
40
  callback_url)
40
41
  end
41
42
 
@@ -2,6 +2,10 @@ module Warden
2
2
  module Github
3
3
  module Oauth
4
4
  class User < Struct.new(:attribs, :token)
5
+ def login
6
+ attribs['login']
7
+ end
8
+
5
9
  def name
6
10
  attribs['name']
7
11
  end
@@ -1,5 +1,5 @@
1
1
  module Warden
2
2
  module Github
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
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: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
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: 2010-06-03 00:00:00 -07:00
18
+ date: 2010-06-17 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency