rack-oauth2 0.4.1 → 0.4.2

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.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = rack-oauth2
2
2
 
3
- Rack Middleware for OAuth2. Currently support only Server/Provider, not Client/Consumer.
3
+ Rack Middleware for OAuth2 server. Experimental OAuth2 client library is also included.
4
4
 
5
5
  This gem is based on OAuth 2.0 draft v.13
6
6
  http://tools.ietf.org/html/draft-ietf-oauth-v2-13
@@ -16,7 +16,7 @@ http://tools.ietf.org/html/draft-ietf-oauth-v2-13
16
16
  * Report Issues on GitHub (http://github.com/nov/rack-oauth2/issues)
17
17
  * Facebook Page (http://www.facebook.com/pages/RackOAuth2/141477809244105)
18
18
 
19
- == Sample Application (Rails3)
19
+ == Sample Server Application (Rails3)
20
20
 
21
21
  Running on Heroku
22
22
  http://rack-oauth2-sample.heroku.com
@@ -24,6 +24,10 @@ http://rack-oauth2-sample.heroku.com
24
24
  Source on GitHub
25
25
  http://github.com/nov/rack-oauth2-sample
26
26
 
27
+ == Sample Client
28
+
29
+ https://gist.github.com/862393
30
+
27
31
  == Note on Patches/Pull Requests
28
32
 
29
33
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -3,7 +3,7 @@ module Rack
3
3
  class Client
4
4
  include AttrRequired, AttrOptional
5
5
  attr_required :identifier
6
- attr_optional :secret, :redirect_uri, :scheme, :host, :response_type, :authorize_endpoint, :token_endpoint
6
+ attr_optional :secret, :redirect_uri, :scheme, :host, :response_type, :authorization_endpoint, :token_endpoint
7
7
 
8
8
  class Exception < StandardError
9
9
  attr_accessor :status, :response
@@ -19,13 +19,13 @@ module Rack
19
19
  self.send "#{key}=", attributes[key]
20
20
  end
21
21
  @grant = Grant::ClientCredentials.new
22
- @authorize_endpoint ||= '/oauth2/authorize'
22
+ @authorization_endpoint ||= '/oauth2/authorize'
23
23
  @token_endpoint ||= '/oauth2/token'
24
24
  attr_missing!
25
25
  end
26
26
 
27
- def authorize_url(response_type = :code, params = {})
28
- absolute_url_for authorize_endpoint, params.merge(
27
+ def authorization_url(response_type = :code, params = {})
28
+ Util.redirect_uri absolute_url_for(authorization_endpoint), :query, params.merge(
29
29
  :client_id => self.identifier,
30
30
  :redirect_uri => self.redirect_uri,
31
31
  :response_type => response_type
@@ -59,11 +59,10 @@ module Rack
59
59
 
60
60
  private
61
61
 
62
- def absolute_url_for(endpoint, params = {})
62
+ def absolute_url_for(endpoint)
63
63
  _endpoint_ = Util.parse_uri endpoint
64
- _endpoint_.scheme ||= 'https'
64
+ _endpoint_.scheme ||= self.scheme || 'https'
65
65
  _endpoint_.host ||= self.host
66
- _endpoint_.query = Util.compact_hash(params).to_query
67
66
  _endpoint_.to_s
68
67
  end
69
68
 
data/rack-oauth2.gemspec CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.version = File.read("VERSION")
4
4
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
5
5
  s.authors = ["nov matake"]
6
- s.description = %q{Rack Middleware for OAuth2 server}
6
+ s.description = %q{Rack Middleware for OAuth2 server. Experimental OAuth2 client library is also included.}
7
7
  s.summary = %q{Rack Middleware for OAuth2 server}
8
8
  s.email = "nov@matake.jp"
9
9
  s.extra_rdoc_files = ["LICENSE", "README.rdoc"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - nov matake
@@ -153,7 +153,7 @@ dependencies:
153
153
  version: "2"
154
154
  type: :development
155
155
  version_requirements: *id009
156
- description: Rack Middleware for OAuth2 server
156
+ description: Rack Middleware for OAuth2 server. Experimental OAuth2 client library is also included.
157
157
  email: nov@matake.jp
158
158
  executables: []
159
159