go_sso 0.5.1 → 0.5.3
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.
- checksums.yaml +4 -4
- data/lib/go_sso/middleware.rb +6 -2
- data/lib/go_sso/version.rb +1 -1
- data/lib/go_sso.rb +4 -4
- metadata +2 -9
- data/app/assets/config/go_sso_manifest.js +0 -1
- data/app/assets/stylesheets/go_sso/application.css +0 -15
- data/app/helpers/go_sso/application_helper.rb +0 -4
- data/app/jobs/go_sso/application_job.rb +0 -4
- data/app/mailers/go_sso/application_mailer.rb +0 -6
- data/app/views/layouts/go_sso/application.html.erb +0 -15
- data/lib/tasks/go_sso_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82f42517041c949c6d627beb357d51b7112c872570bfeb7774776d991a0e79b6
|
4
|
+
data.tar.gz: 0db369bc5b36105525906367ba5722b7be47f4cc3f2c8033cecc27b9881c5fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeca4a5f209bf76776e5128ed2dae8c2c7eb9fd40f038b19173d2af254f49a1647ef1ebefbaa19684fef629768ec1b938a354238dcdc06ab05bd7c2a02624d99
|
7
|
+
data.tar.gz: feaa9197bbe0069cda058cce21d3d22875feae736061a2ffbf2498c8080ec6009b200bca5d09a963da52150d8199592f45072613c00061a78630dcb3cee31244
|
data/lib/go_sso/middleware.rb
CHANGED
@@ -38,7 +38,7 @@ module GoSso
|
|
38
38
|
if GoSso.test_mode?
|
39
39
|
redirect client_callback_path
|
40
40
|
else
|
41
|
-
redirect GoSso.authorize_url
|
41
|
+
redirect GoSso.authorize_url(url_options)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -48,7 +48,7 @@ module GoSso
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def callback_call
|
51
|
-
token = GoSso.test_mode? ? GoSso.generate_fake_token : GoSso.get_token(request.params["code"])
|
51
|
+
token = GoSso.test_mode? ? GoSso.generate_fake_token : GoSso.get_token(request.params["code"], url_options)
|
52
52
|
set_sso_token(token.token, expires_at: token.expires_at)
|
53
53
|
@app.call(@env)
|
54
54
|
rescue OAuth2::Error => error
|
@@ -98,5 +98,9 @@ module GoSso
|
|
98
98
|
path = request.script_name.to_s.chomp("/")
|
99
99
|
path << _path if _path.present?
|
100
100
|
end
|
101
|
+
|
102
|
+
def url_options
|
103
|
+
{ script_name: request.script_name }
|
104
|
+
end
|
101
105
|
end
|
102
106
|
end
|
data/lib/go_sso/version.rb
CHANGED
data/lib/go_sso.rb
CHANGED
@@ -39,12 +39,12 @@ module GoSso
|
|
39
39
|
@client ||= OAuth2::Client.new(client_id, client_secret, site: site)
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.authorize_url
|
43
|
-
client.auth_code.authorize_url(redirect_uri: Rails.application.routes.url_helpers.go_sso_callback_url(host: current_host))
|
42
|
+
def self.authorize_url(url_options = {})
|
43
|
+
client.auth_code.authorize_url(redirect_uri: Rails.application.routes.url_helpers.go_sso_callback_url(host: current_host, **url_options))
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.get_token(code)
|
47
|
-
client.auth_code.get_token(code, redirect_uri: Rails.application.routes.url_helpers.go_sso_callback_url(host: current_host))
|
46
|
+
def self.get_token(code, url_options = {})
|
47
|
+
client.auth_code.get_token(code, redirect_uri: Rails.application.routes.url_helpers.go_sso_callback_url(host: current_host, **url_options))
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.current_host
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yi Feng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|
@@ -118,13 +118,7 @@ files:
|
|
118
118
|
- MIT-LICENSE
|
119
119
|
- README.md
|
120
120
|
- Rakefile
|
121
|
-
- app/assets/config/go_sso_manifest.js
|
122
|
-
- app/assets/stylesheets/go_sso/application.css
|
123
121
|
- app/controllers/go_sso/application_controller.rb
|
124
|
-
- app/helpers/go_sso/application_helper.rb
|
125
|
-
- app/jobs/go_sso/application_job.rb
|
126
|
-
- app/mailers/go_sso/application_mailer.rb
|
127
|
-
- app/views/layouts/go_sso/application.html.erb
|
128
122
|
- config/routes.rb
|
129
123
|
- lib/go_sso.rb
|
130
124
|
- lib/go_sso/controllers/helpers.rb
|
@@ -133,7 +127,6 @@ files:
|
|
133
127
|
- lib/go_sso/middleware.rb
|
134
128
|
- lib/go_sso/user.rb
|
135
129
|
- lib/go_sso/version.rb
|
136
|
-
- lib/tasks/go_sso_tasks.rake
|
137
130
|
homepage: https://github.com/yfxie/go_sso
|
138
131
|
licenses:
|
139
132
|
- MIT
|
@@ -1 +0,0 @@
|
|
1
|
-
//= link_directory ../stylesheets/go_sso .css
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
data/lib/tasks/go_sso_tasks.rake
DELETED