doorkeeper-openid_connect 1.8.1 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09f27d32ffb416432a70412926bdd053ef3c715615d503ea468fe00471e00dc0'
4
- data.tar.gz: 36c769e0736aba2a90576b9837201b692205bbd4506db709b70e9cd544b7e15f
3
+ metadata.gz: 580964e8b1538ed3a9eb35826fe502698ab43c7a7343909d5371d2e177592737
4
+ data.tar.gz: 3593a4e8975761cff3aa38840a88f8e21da5e65109fb90b7296dccb7442c6382
5
5
  SHA512:
6
- metadata.gz: 9d9a70bf130b96e1f1d51d28781c7d2bab443876c7d2a25f8fa3ab674b5bcc406342e7787f8681fa6ec81ea8223011f48600e2c9b257c774766c522a8e74c1b9
7
- data.tar.gz: 063e9d61009275044b6b6ff98bfd068a7873d7986e407616c5363aedba127989f48da9ff1fe6489895d6ea62b3db5ed69185557b505d02391dc6f935c3dbbc7b
6
+ metadata.gz: 80e1ca10f0d89071970458b2ac237164cba4c8e143abcd2ea3f45b727f35f59e3f106d4435d2066b759eec8cc599e904255b57ff560743e29c5eb3a78ef8efca
7
+ data.tar.gz: 741c3d256765a8bd6ca5d838ac2ced86dadf98635b5d39c64a2a589231c9ba2151be4822ec7b9c11aac48d819261823319d4161a5702d00cab492acb00aa04d3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  - [#] Add here
4
4
 
5
+ ## v1.8.2 (2022-07-13)
6
+
7
+ - [#168] Allow to use custom doorkeeper access grant model (thanks @nov).
8
+ - [#170] Controllers inherit `Doorkeeper::AppliactionMetalController` (thanks @sato11).
9
+ - [#171] Correctly override `AuthorizationsController` params (thanks to @nbulaj).
10
+
5
11
  ## v1.8.1 (2022-02-09)
6
12
 
7
13
  - [#153] Fix ArgumentError caused by client credential validation introduced in Doorkeeper 5.5.1 (thanks to @CircumnavigatingFlatEarther)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Doorkeeper::OpenidConnect
2
2
 
3
- [![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper-openid_connect.svg?branch=master)](https://travis-ci.org/doorkeeper-gem/doorkeeper-openid_connect)
3
+ [![Build Status](https://app.travis-ci.com/doorkeeper-gem/doorkeeper-openid_connect.svg?branch=master)](https://app.travis-ci.com/github/doorkeeper-gem/doorkeeper-openid_connect)
4
4
  [![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper-openid_connect.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper-openid_connect)
5
5
  [![Gem Version](https://badge.fury.io/rb/doorkeeper-openid_connect.svg)](https://rubygems.org/gems/doorkeeper-openid_connect)
6
6
 
@@ -0,0 +1,12 @@
1
+ module Doorkeeper
2
+ module OpenidConnect
3
+ module AuthorizationsExtension
4
+ private
5
+
6
+ def pre_auth_param_fields
7
+ super.append(:nonce)
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Doorkeeper
4
4
  module OpenidConnect
5
- class DiscoveryController < ::Doorkeeper::ApplicationController
5
+ class DiscoveryController < ::Doorkeeper::ApplicationMetalController
6
6
  include Doorkeeper::Helpers::Controller
7
7
 
8
8
  WEBFINGER_RELATION = 'http://openid.net/specs/connect/1.0/issuer'
@@ -30,7 +30,7 @@ module Doorkeeper
30
30
  authorization_endpoint: oauth_authorization_url(authorization_url_options),
31
31
  token_endpoint: oauth_token_url(token_url_options),
32
32
  revocation_endpoint: oauth_revoke_url(revocation_url_options),
33
- introspection_endpoint: oauth_introspect_url(introspection_url_options),
33
+ introspection_endpoint: respond_to?(:oauth_introspect_url) ? oauth_introspect_url(introspection_url_options) : nil,
34
34
  userinfo_endpoint: oauth_userinfo_url(userinfo_url_options),
35
35
  jwks_uri: oauth_discovery_keys_url(jwks_url_options),
36
36
  end_session_endpoint: instance_exec(&openid_connect.end_session_endpoint),
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Doorkeeper
4
4
  module OpenidConnect
5
- class UserinfoController < ::Doorkeeper::ApplicationController
6
- unless Doorkeeper.configuration.api_only
7
- skip_before_action :verify_authenticity_token
8
- end
5
+ class UserinfoController < ::Doorkeeper::ApplicationMetalController
9
6
  before_action -> { doorkeeper_authorize! :openid }
10
7
 
11
8
  def show
@@ -6,6 +6,10 @@ module Doorkeeper
6
6
  initializer 'doorkeeper.openid_connect.routes' do
7
7
  Doorkeeper::OpenidConnect::Rails::Routes.install!
8
8
  end
9
+
10
+ config.to_prepare do
11
+ Doorkeeper::AuthorizationsController.prepend Doorkeeper::OpenidConnect::AuthorizationsExtension
12
+ end
9
13
  end
10
14
  end
11
15
  end
@@ -7,12 +7,11 @@ module Doorkeeper
7
7
  base.class_eval do
8
8
  has_one :openid_request,
9
9
  class_name: 'Doorkeeper::OpenidConnect::Request',
10
+ foreign_key: 'access_grant_id',
10
11
  inverse_of: :access_grant,
11
12
  dependent: :delete
12
13
  end
13
14
  end
14
15
  end
15
16
  end
16
-
17
- AccessGrant.prepend OpenidConnect::AccessGrant
18
17
  end
@@ -6,9 +6,16 @@ module Doorkeeper
6
6
  self.table_name = "#{table_name_prefix}oauth_openid_requests#{table_name_suffix}".to_sym
7
7
 
8
8
  validates :access_grant_id, :nonce, presence: true
9
- belongs_to :access_grant,
10
- class_name: 'Doorkeeper::AccessGrant',
11
- inverse_of: :openid_request
9
+
10
+ if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0')
11
+ belongs_to :access_grant,
12
+ class_name: Doorkeeper.config.access_grant_class.to_s,
13
+ inverse_of: :openid_request
14
+ else
15
+ belongs_to :access_grant,
16
+ class_name: 'Doorkeeper::AccessGrant',
17
+ inverse_of: :openid_request
18
+ end
12
19
  end
13
20
  end
14
21
  end
@@ -4,14 +4,39 @@ require 'active_support/lazy_load_hooks'
4
4
 
5
5
  module Doorkeeper
6
6
  module OpenidConnect
7
+ autoload :AccessGrant, "doorkeeper/openid_connect/orm/active_record/access_grant"
8
+ autoload :Request, "doorkeeper/openid_connect/orm/active_record/request"
9
+
7
10
  module Orm
8
11
  module ActiveRecord
12
+ def run_hooks
13
+ super
14
+
15
+ if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0')
16
+ Doorkeeper.config.access_grant_model.prepend Doorkeeper::OpenidConnect::AccessGrant
17
+ else
18
+ Doorkeeper::AccessGrant.prepend Doorkeeper::OpenidConnect::AccessGrant
19
+ end
20
+
21
+ if Doorkeeper.configuration.active_record_options[:establish_connection]
22
+ [Doorkeeper::OpenidConnect::Request].each do |c|
23
+ c.send :establish_connection, Doorkeeper.configuration.active_record_options[:establish_connection]
24
+ end
25
+ end
26
+ end
27
+
9
28
  def initialize_models!
10
29
  super
11
30
  ActiveSupport.on_load(:active_record) do
12
31
  require 'doorkeeper/openid_connect/orm/active_record/access_grant'
13
32
  require 'doorkeeper/openid_connect/orm/active_record/request'
14
33
 
34
+ if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0')
35
+ Doorkeeper.config.access_grant_model.prepend Doorkeeper::OpenidConnect::AccessGrant
36
+ else
37
+ Doorkeeper::AccessGrant.prepend Doorkeeper::OpenidConnect::AccessGrant
38
+ end
39
+
15
40
  if Doorkeeper.configuration.active_record_options[:establish_connection]
16
41
  [Doorkeeper::OpenidConnect::Request].each do |c|
17
42
  c.send :establish_connection, Doorkeeper.configuration.active_record_options[:establish_connection]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Doorkeeper
4
4
  module OpenidConnect
5
- VERSION = '1.8.1'
5
+ VERSION = '1.8.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doorkeeper-openid_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Dengler
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-09 00:00:00.000000000 Z
12
+ date: 2022-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: doorkeeper
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '5.5'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '5.6'
23
+ version: '5.7'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '5.5'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.6'
33
+ version: '5.7'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: json-jwt
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ files:
126
126
  - CHANGELOG.md
127
127
  - LICENSE.txt
128
128
  - README.md
129
- - app/controllers/doorkeeper/authorizations_controller.rb
129
+ - app/controllers/concerns/doorkeeper/openid_connect/authorizations_extension.rb
130
130
  - app/controllers/doorkeeper/openid_connect/discovery_controller.rb
131
131
  - app/controllers/doorkeeper/openid_connect/userinfo_controller.rb
132
132
  - config/locales/en.yml
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.0.8
187
+ rubygems_version: 3.1.4
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: OpenID Connect extension for Doorkeeper.
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_dependency "#{Doorkeeper::Engine.root}/app/controllers/doorkeeper/authorizations_controller.rb"
4
-
5
- module Doorkeeper
6
- class AuthorizationsController
7
- module AuthorizationsExtension
8
- private
9
-
10
- def pre_auth_param_fields
11
- super.append(:nonce)
12
- end
13
- end
14
-
15
- Doorkeeper::AuthorizationsController.prepend AuthorizationsExtension
16
- end
17
- end