cas_client 0.2.3 → 0.2.4
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.
- data/lib/cas_client/user_api.rb +6 -4
- data/lib/cas_client/version.rb +1 -1
- metadata +4 -4
data/lib/cas_client/user_api.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'cgi'
|
2
3
|
require 'yajl'
|
3
4
|
|
4
5
|
module CASClient
|
@@ -37,7 +38,7 @@ module CASClient
|
|
37
38
|
|
38
39
|
def fetch(uri_string, limit = 10)
|
39
40
|
raise StandardError, 'HTTP redirect too deep' if limit == 0
|
40
|
-
uri_string =
|
41
|
+
uri_string = CGI.escape(uri_string)
|
41
42
|
url = URI.parse(uri_string)
|
42
43
|
handle_response(make_request(url, Net::HTTP::Get.new(url.path)), limit)
|
43
44
|
end
|
@@ -101,7 +102,8 @@ module CASClient
|
|
101
102
|
else
|
102
103
|
_user_identifier = self.send(self.class.cas_map[:uuid])
|
103
104
|
end
|
104
|
-
|
105
|
+
uri_string = CGI.escape("#{::CAS_SERVER["internal_cas_domain"]}/api/users/#{_user_identifier}")
|
106
|
+
url = URI.parse(uri_string)
|
105
107
|
res = handle_response(make_request(url, Net::HTTP::Put.new(url.path)))
|
106
108
|
Yajl::Parser.new(:symbolize_keys => true).parse(res.body)
|
107
109
|
end
|
@@ -118,7 +120,7 @@ module CASClient
|
|
118
120
|
|
119
121
|
def fetch(uri_string, limit = 10)
|
120
122
|
raise StandardError, 'HTTP redirect too deep' if limit == 0
|
121
|
-
uri_string =
|
123
|
+
uri_string = CGI.escape(uri_string)
|
122
124
|
url = URI.parse(uri_string)
|
123
125
|
handle_response(make_request(url, Net::HTTP::Get.new(url.path)), limit)
|
124
126
|
end
|
@@ -177,4 +179,4 @@ module CASClient
|
|
177
179
|
private :build_user_attributes_hash
|
178
180
|
|
179
181
|
end
|
180
|
-
end
|
182
|
+
end
|
data/lib/cas_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cas_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Moran
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|