go_sso 0.4.3 → 0.5.0
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 +11 -6
- data/lib/go_sso/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 904cedd809a2f4bb6f9ddc5ab11b8ed3cae039228ab577d69179141b0cdaf1e5
|
|
4
|
+
data.tar.gz: 1f5e0e051a65b642a2cd67451fed20331addafd217f9743811fc737128debb13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '079edece6cd52dc37af2f776c93dcbf25f98c33761d05b1b9aaa5fe2157257fbfb8a5680d0eb335208a643f69a1db9a7c6dd0f038cd44ac4e8b3c7eb075ab644'
|
|
7
|
+
data.tar.gz: b19abc01a2637483138f1c11d420eb34f004118e9494b45dff14b173c16dda5ecb0c9a02e989eb3de80cea6936dbaf287484e3bb6ef61f0d891df5a56104ddd2
|
data/lib/go_sso/middleware.rb
CHANGED
|
@@ -34,8 +34,9 @@ module GoSso
|
|
|
34
34
|
|
|
35
35
|
def request_call
|
|
36
36
|
session[:go_sso_referrer] = request.params["redirect_url"] || request.referrer || request.base_url
|
|
37
|
+
|
|
37
38
|
if GoSso.test_mode?
|
|
38
|
-
redirect
|
|
39
|
+
redirect client_callback_path
|
|
39
40
|
else
|
|
40
41
|
redirect GoSso.authorize_url
|
|
41
42
|
end
|
|
@@ -54,18 +55,16 @@ module GoSso
|
|
|
54
55
|
fail!({ code: error.code, description: error.description })
|
|
55
56
|
end
|
|
56
57
|
|
|
57
|
-
def
|
|
58
|
-
"#{GoSso.routes_prefix}/callback"
|
|
58
|
+
def client_callback_path
|
|
59
|
+
path_with_script_name("#{GoSso.routes_prefix}/callback")
|
|
59
60
|
end
|
|
60
61
|
|
|
61
62
|
def on_path?(path)
|
|
62
63
|
current_path.casecmp(path).zero?
|
|
63
64
|
end
|
|
64
65
|
|
|
65
|
-
CURRENT_PATH_REGEX = %r{/$}.freeze
|
|
66
|
-
EMPTY_STRING = ''.freeze
|
|
67
66
|
def current_path
|
|
68
|
-
@
|
|
67
|
+
@request.path_info
|
|
69
68
|
end
|
|
70
69
|
|
|
71
70
|
def request
|
|
@@ -93,5 +92,11 @@ module GoSso
|
|
|
93
92
|
def fail!(hash)
|
|
94
93
|
[200, { 'Content-Type' => 'application/json' }, [hash.to_json]]
|
|
95
94
|
end
|
|
95
|
+
|
|
96
|
+
private
|
|
97
|
+
def path_with_script_name(_path)
|
|
98
|
+
path = request.script_name.to_s.chomp("/")
|
|
99
|
+
path << _path if _path.present?
|
|
100
|
+
end
|
|
96
101
|
end
|
|
97
102
|
end
|
data/lib/go_sso/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yi Feng
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oauth2
|
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
154
|
version: '0'
|
|
155
155
|
requirements: []
|
|
156
|
-
rubygems_version: 3.
|
|
156
|
+
rubygems_version: 3.3.7
|
|
157
157
|
signing_key:
|
|
158
158
|
specification_version: 4
|
|
159
159
|
summary: Summary of GoSso.
|