oidc_provider 0.3.7 → 0.3.10

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: 549e90cc02233123dcb8a39bf6ce932b5ab6a184634e182fe3c9ab3fc041b874
4
- data.tar.gz: d795833672a20caa6b0826bea62dd49c055007af06a5abd5d2ac5a7e3e4261d2
3
+ metadata.gz: da21094ceda40451619c72e143399acf170b98f031eae7e0db2ec7e0e7dd97a6
4
+ data.tar.gz: 41be8a950f2a1c96afae1c8db4e2ea8f3ac1629419ef206c4123580426f5a125
5
5
  SHA512:
6
- metadata.gz: 3e1130f76cc114fcce43cb70587402f802e3b06328923541eb5e00fc6ce385897531f8215ecd129fe24d97916186e773c20b9c6d39c357b9dbd36d6530bb1609
7
- data.tar.gz: fae1e2e09a6eff7a660a440e2a5c9486f444c04d9c7c25b2722d7ac331bb9c733df03bdf14d78955cabfdf5b5ccd4c00a36dc4b673bc8fb3050ac2d1c755b030
6
+ metadata.gz: 76a5ece3b674d0ab2e72af183c3333dcbe3fbb347f0503ce1aafc09b0cfbd1ba7e66ebe3f0ad2393953a5686875cc2f5f22e5dc557e6bc37de204c2b7ec2cd41
7
+ data.tar.gz: eb859617ee41d779fc5e34ac2af239ab2d87b48634c5639080496930aff58cab487292660c520a3f336d451f40ea87f1fb32ec0cfb5beb4c14d9ffb636331ad2
data/README.md CHANGED
@@ -92,5 +92,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
92
92
 
93
93
  ```
94
94
  gem build oidc_provider.gemspec
95
- gem push oidc_provider-0.3.2.gem
95
+ gem push oidc_provider-0.3.10.gem
96
96
  ```
@@ -1,6 +1,25 @@
1
1
  module OIDCProvider
2
2
  class ApplicationController < ActionController::Base
3
- include Concerns::Authentication
4
- include Concerns::Session
3
+ def oidc_current_account
4
+ send(OIDCProvider.current_account_method)
5
+ end
6
+
7
+ def current_token
8
+ @current_token ||= request.env[Rack::OAuth2::Server::Resource::ACCESS_TOKEN]
9
+ end
10
+
11
+ def require_authentication
12
+ send(OIDCProvider.current_authentication_method)
13
+ end
14
+
15
+ def require_access_token
16
+ unless current_token
17
+ raise Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
18
+ end
19
+ end
20
+
21
+ def unauthenticate!
22
+ send(OIDCProvider.current_unauthenticate_method)
23
+ end
5
24
  end
6
25
  end
@@ -21,7 +21,7 @@ module OIDCProvider
21
21
  }]
22
22
  }
23
23
  jrd[:subject] = params[:resource] if params[:resource].present?
24
- render json: jrd, content_type: Mime::JRD
24
+ render json: jrd, content_type: "application/jrd+json"
25
25
  end
26
26
 
27
27
  def openid_configuration
@@ -4,7 +4,8 @@ module OIDCProvider
4
4
 
5
5
  def destroy
6
6
  unauthenticate!
7
- redirect_to after_oidc_sign_out_path
7
+ redirect_to "/" unless OIDCProvider.after_sign_out_path
8
+ redirect_to OIDCProvider.after_sign_out_path.respond_to?(:call) ? OIDCProvider.after_sign_out_path.call(params) : OIDCProvider.after_sign_out_path
8
9
  end
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module OIDCProvider
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.10'
3
3
  end
data/lib/oidc_provider.rb CHANGED
@@ -40,6 +40,8 @@ module OIDCProvider
40
40
  mattr_accessor :account_identifier
41
41
  @@account_identifier = :id
42
42
 
43
+ mattr_accessor :after_sign_out_path
44
+
43
45
  def self.add_client(&block)
44
46
  @@clients << Client::Builder.new(&block).build
45
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oidc_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Carey
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-20 00:00:00.000000000 Z
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -50,9 +50,7 @@ files:
50
50
  - Rakefile
51
51
  - app/controllers/oidc_provider/application_controller.rb
52
52
  - app/controllers/oidc_provider/authorizations_controller.rb
53
- - app/controllers/oidc_provider/concerns/authentication.rb
54
53
  - app/controllers/oidc_provider/concerns/connect_endpoint.rb
55
- - app/controllers/oidc_provider/concerns/session.rb
56
54
  - app/controllers/oidc_provider/discovery_controller.rb
57
55
  - app/controllers/oidc_provider/sessions_controller.rb
58
56
  - app/controllers/oidc_provider/user_infos_controller.rb
@@ -76,11 +74,11 @@ files:
76
74
  - lib/oidc_provider/user_info_builder.rb
77
75
  - lib/oidc_provider/version.rb
78
76
  - lib/tasks/openid/connect/provider_tasks.rake
79
- homepage: http://brandnewbox.com
77
+ homepage: https://github.com/brandnewbox/oidc_provider
80
78
  licenses:
81
79
  - MIT
82
80
  metadata: {}
83
- post_install_message:
81
+ post_install_message:
84
82
  rdoc_options: []
85
83
  require_paths:
86
84
  - lib
@@ -95,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
93
  - !ruby/object:Gem::Version
96
94
  version: '0'
97
95
  requirements: []
98
- rubygems_version: 3.0.3
99
- signing_key:
96
+ rubygems_version: 3.3.7
97
+ signing_key:
100
98
  specification_version: 4
101
99
  summary: Uses the openid_connect gem to turn a Rails app into an OpenID Connect provider.
102
100
  test_files: []
@@ -1,27 +0,0 @@
1
- module OIDCProvider
2
- module Concerns
3
- module Authentication
4
- def oidc_current_account
5
- send(OIDCProvider.current_account_method)
6
- end
7
-
8
- def current_token
9
- @current_token ||= request.env[Rack::OAuth2::Server::Resource::ACCESS_TOKEN]
10
- end
11
-
12
- def require_authentication
13
- send(OIDCProvider.current_authentication_method)
14
- end
15
-
16
- def require_access_token
17
- unless current_token
18
- raise Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
19
- end
20
- end
21
-
22
- def unauthenticate!
23
- send(OIDCProvider.current_unauthenticate_method)
24
- end
25
- end
26
- end
27
- end
@@ -1,9 +0,0 @@
1
- module OIDCProvider
2
- module Concerns
3
- module Session
4
- def after_oidc_sign_out_path
5
- "/"
6
- end
7
- end
8
- end
9
- end