openid_connect 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -12,13 +12,15 @@ module OpenIDConnect
12
12
  if claims.present?
13
13
  _claims_ = {}
14
14
  claims.each do |key, value|
15
- _claims_[key] = case value
16
- when :optional, 'optional'
15
+ _claims_[key] = case value.to_s
16
+ when 'optional'
17
17
  {
18
- :optional => true
18
+ :essential => false
19
+ }
20
+ when 'required', 'essential'
21
+ {
22
+ :essential => true
19
23
  }
20
- when :required, 'required'
21
- nil
22
24
  else
23
25
  value
24
26
  end
@@ -6,7 +6,7 @@ module OpenIDConnect
6
6
  class InvalidToken < Exception; end
7
7
 
8
8
  attr_required :iss, :user_id, :aud, :exp, :iat
9
- attr_optional :acr, :auth_time, :nonce, :at_hash
9
+ attr_optional :acr, :auth_time, :nonce, :at_hash, :c_hash
10
10
 
11
11
  def initialize(attributes = {})
12
12
  super
@@ -0,0 +1,34 @@
1
+ module Rack
2
+ module OAuth2
3
+ module Server
4
+ class Authorize
5
+ module ErrorWithConnectExt
6
+ DEFAULT_DESCRIPTION = {
7
+ :invalid_redirect_uri => 'The redirect_uri in the request does not match any of pre-registered redirect_uris.',
8
+ :interaction_required => 'End-User interaction required.',
9
+ :login_required => 'End-User authentication required.',
10
+ :session_selection_required => 'The End-User is required to select a session at the Authorization Server.',
11
+ :consent_required => 'End-User consent required.',
12
+ :invalid_request_uri => 'The request_uri in the request returns an error or invalid data.',
13
+ :invalid_openid_request_object => 'The request parameter contains an invalid OpenID Request Object.'
14
+ }
15
+
16
+ def self.included(klass)
17
+ DEFAULT_DESCRIPTION.each do |error, default_description|
18
+ # NOTE:
19
+ # Connect Message spec doesn't say anything about HTTP status code for each error code.
20
+ # It probably means "use 400".
21
+ error_method = :bad_request!
22
+ klass.class_eval <<-ERROR
23
+ def #{error}!(description = "#{default_description}", options = {})
24
+ #{error_method} :#{error}, description, options
25
+ end
26
+ ERROR
27
+ end
28
+ end
29
+ end
30
+ Request.send :include, ErrorWithConnectExt
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,6 +1,6 @@
1
1
  class Rack::OAuth2::Server::Authorize
2
2
  module RequestWithConnectParams
3
- CONNECT_EXT_PARAMS = [:nonce, :display, :prompt, :request, :request_uri]
3
+ CONNECT_EXT_PARAMS = [:nonce, :display, :prompt, :request, :request_uri, :id_token]
4
4
 
5
5
  def self.included(klass)
6
6
  klass.send :attr_optional, *CONNECT_EXT_PARAMS
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openid_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-04 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -261,6 +261,7 @@ files:
261
261
  - lib/openid_connect/response_object/user_info.rb
262
262
  - lib/openid_connect/response_object/user_info/open_id.rb
263
263
  - lib/openid_connect/response_object/user_info/open_id/address.rb
264
+ - lib/rack/oauth2/server/authorize/error_with_connect_ext.rb
264
265
  - lib/rack/oauth2/server/authorize/extension/code_and_id_token.rb
265
266
  - lib/rack/oauth2/server/authorize/extension/code_and_id_token_and_token.rb
266
267
  - lib/rack/oauth2/server/authorize/extension/id_token.rb