go_sso 0.4.3 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- 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: 820466a094af966f05a86479a8ec075ed52b9a0a9000d9da62234e5ffa1ddc57
|
4
|
+
data.tar.gz: 3a492b2f18a06fe405049c55965e51a29595e887f4870462167ad9fc51ed3bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d876d4f6d5c653f0754a3b1ba3e5a949e8abb61d739cca90c5fb9673ccbca6560fad8f8581581e2f01a2bcc61bdc0f1933159fe52c989050f394aaab226030f
|
7
|
+
data.tar.gz: f9a8344b189af75400b75eebf75d056d94eb5ede2677425f0c65c285955ae67ecdde99e332dbf3890113d8b1e82c71a6e7b01295220411dad51cb49616c15f07
|
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.chomp("/")
|
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.1
|
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.
|