gunark-rubycas-server 0.8.0.20090213 → 0.8.0.20090225
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/History.txt +6 -3
- data/bin/rubycas-server +1 -1
- data/lib/casserver/controllers.rb +41 -41
- metadata +12 -10
data/History.txt
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
=== 0.8.0 :: In Progress...
|
2
2
|
|
3
3
|
* NEW:
|
4
|
-
* Support for localization via Ruby-GetText.
|
5
|
-
|
4
|
+
* Support for localization via Ruby-GetText.
|
5
|
+
See http://code.google.com/p/rubycas-server/wiki/Localization
|
6
|
+
for details. [antono]
|
7
|
+
* Switched to Picnic 0.8.0, so RubyCAS-Server is now based on Rack
|
8
|
+
and Camping 2.0 and is also now compatible with Passenger Phusion
|
9
|
+
* Added new SQL authenticator (sql_rest_auth) compatible with the
|
6
10
|
restful_authentication Rails plugin. [antono]
|
7
|
-
* Compatible with Passenger Phusion -- TODO: provide link to howto
|
8
11
|
|
9
12
|
* FIXED:
|
10
13
|
* Fixed weird problems with loading controllers when using older versions of
|
data/bin/rubycas-server
CHANGED
@@ -21,7 +21,7 @@ require 'picnic/cli'
|
|
21
21
|
cli = Picnic::Cli.new(
|
22
22
|
'rubycas-server',
|
23
23
|
:app_module => 'CASServer',
|
24
|
-
:app_file => File.expand_path(File.dirname(File.expand_path(
|
24
|
+
:app_file => File.expand_path(File.dirname(File.expand_path(__FILE__))+"/../lib/casserver.rb")
|
25
25
|
)
|
26
26
|
|
27
27
|
cli.handle_cli_input
|
@@ -11,7 +11,7 @@ module CASServer::Controllers
|
|
11
11
|
|
12
12
|
# 2.1.1
|
13
13
|
def get
|
14
|
-
CASServer::Utils::log_controller_action(self.class,
|
14
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
15
15
|
|
16
16
|
# make sure there's no caching
|
17
17
|
headers['Pragma'] = 'no-cache'
|
@@ -19,11 +19,11 @@ module CASServer::Controllers
|
|
19
19
|
headers['Expires'] = (Time.now - 1.year).rfc2822
|
20
20
|
|
21
21
|
# optional params
|
22
|
-
@service = clean_service_url(
|
23
|
-
@renew =
|
24
|
-
@gateway =
|
22
|
+
@service = clean_service_url(input['service'])
|
23
|
+
@renew = input['renew']
|
24
|
+
@gateway = input['gateway'] == 'true' || input['gateway'] == '1'
|
25
25
|
|
26
|
-
if tgc =
|
26
|
+
if tgc = cookies['tgt']
|
27
27
|
tgt, tgt_error = validate_ticket_granting_ticket(tgc)
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,7 @@ module CASServer::Controllers
|
|
32
32
|
:message => _("You are currently logged in as '%s'. If this is not you, please log in below.") % tgt.username }
|
33
33
|
end
|
34
34
|
|
35
|
-
if
|
35
|
+
if input['redirection_loop_intercepted']
|
36
36
|
@message = {:type => 'mistake',
|
37
37
|
:message => _("The client and server are unable to negotiate authentication. Please try logging in again later.")}
|
38
38
|
end
|
@@ -72,14 +72,14 @@ module CASServer::Controllers
|
|
72
72
|
# embed the login form in some external page (as an IFRAME, or otherwise).
|
73
73
|
# The optional 'submitToURI' parameter can be given to explicitly set the
|
74
74
|
# action for the form, otherwise the server will try to guess this for you.
|
75
|
-
if
|
75
|
+
if input.has_key? 'onlyLoginForm'
|
76
76
|
if @env['HTTP_HOST']
|
77
77
|
guessed_login_uri = "http#{@env['HTTPS'] && @env['HTTPS'] == 'on' ? 's' : ''}://#{@env['REQUEST_URI']}#{self / '/login'}"
|
78
78
|
else
|
79
79
|
guessed_login_uri = nil
|
80
80
|
end
|
81
81
|
|
82
|
-
@form_action =
|
82
|
+
@form_action = input['submitToURI'] || guessed_login_uri
|
83
83
|
|
84
84
|
if @form_action
|
85
85
|
render :login_form
|
@@ -94,15 +94,15 @@ module CASServer::Controllers
|
|
94
94
|
|
95
95
|
# 2.2
|
96
96
|
def post
|
97
|
-
CASServer::Utils::log_controller_action(self.class,
|
97
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
98
98
|
|
99
99
|
# 2.2.1 (optional)
|
100
|
-
@service = clean_service_url(
|
100
|
+
@service = clean_service_url(input['service'])
|
101
101
|
|
102
102
|
# 2.2.2 (required)
|
103
|
-
@username =
|
104
|
-
@password =
|
105
|
-
@lt =
|
103
|
+
@username = input['username']
|
104
|
+
@password = input['password']
|
105
|
+
@lt = input['lt']
|
106
106
|
|
107
107
|
# Remove leading and trailing widespace from username.
|
108
108
|
@username.strip! if @username
|
@@ -169,15 +169,15 @@ module CASServer::Controllers
|
|
169
169
|
end
|
170
170
|
|
171
171
|
if $CONF.expire_sessions
|
172
|
-
|
172
|
+
cookies['tgt'] = {
|
173
173
|
:value => tgt.to_s,
|
174
174
|
:expires => Time.now + $CONF.ticket_granting_ticket_expiry
|
175
175
|
}
|
176
176
|
else
|
177
|
-
|
177
|
+
cookies['tgt'] = tgt.to_s
|
178
178
|
end
|
179
179
|
|
180
|
-
$LOG.debug("Ticket granting cookie '#{
|
180
|
+
$LOG.debug("Ticket granting cookie '#{cookies['tgt'].inspect}' granted to '#{@username.inspect}'. #{expiry_info}")
|
181
181
|
|
182
182
|
if @service.blank?
|
183
183
|
$LOG.info("Successfully authenticated user '#{@username}' at '#{tgt.client_hostname}'. No service param was given, so we will not redirect.")
|
@@ -211,20 +211,20 @@ module CASServer::Controllers
|
|
211
211
|
|
212
212
|
# 2.3.1
|
213
213
|
def get
|
214
|
-
CASServer::Utils::log_controller_action(self.class,
|
214
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
215
215
|
|
216
216
|
# The behaviour here is somewhat non-standard. Rather than showing just a blank
|
217
217
|
# "logout" page, we take the user back to the login page with a "you have been logged out"
|
218
218
|
# message, allowing for an opportunity to immediately log back in. This makes it
|
219
219
|
# easier for the user to log out and log in as someone else.
|
220
|
-
@service = clean_service_url(
|
221
|
-
@continue_url =
|
220
|
+
@service = clean_service_url(input['service'] || input['destination'])
|
221
|
+
@continue_url = input['url']
|
222
222
|
|
223
|
-
@gateway =
|
223
|
+
@gateway = input['gateway'] == 'true' || input['gateway'] == '1'
|
224
224
|
|
225
|
-
tgt = CASServer::Models::TicketGrantingTicket.find_by_ticket(
|
225
|
+
tgt = CASServer::Models::TicketGrantingTicket.find_by_ticket(cookies['tgt'])
|
226
226
|
|
227
|
-
|
227
|
+
cookies.delete 'tgt'
|
228
228
|
|
229
229
|
if tgt
|
230
230
|
CASServer::Models::TicketGrantingTicket.transaction do
|
@@ -279,13 +279,13 @@ module CASServer::Controllers
|
|
279
279
|
|
280
280
|
# 2.4.1
|
281
281
|
def get
|
282
|
-
CASServer::Utils::log_controller_action(self.class,
|
282
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
283
283
|
|
284
284
|
# required
|
285
|
-
@service = clean_service_url(
|
286
|
-
@ticket =
|
285
|
+
@service = clean_service_url(input['service'])
|
286
|
+
@ticket = input['ticket']
|
287
287
|
# optional
|
288
|
-
@renew =
|
288
|
+
@renew = input['renew']
|
289
289
|
|
290
290
|
st, @error = validate_service_ticket(@service, @ticket)
|
291
291
|
@success = st && !@error
|
@@ -304,14 +304,14 @@ module CASServer::Controllers
|
|
304
304
|
|
305
305
|
# 2.5.1
|
306
306
|
def get
|
307
|
-
CASServer::Utils::log_controller_action(self.class,
|
307
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
308
308
|
|
309
309
|
# required
|
310
|
-
@service = clean_service_url(
|
311
|
-
@ticket =
|
310
|
+
@service = clean_service_url(input['service'])
|
311
|
+
@ticket = input['ticket']
|
312
312
|
# optional
|
313
|
-
@pgt_url =
|
314
|
-
@renew =
|
313
|
+
@pgt_url = input['pgtUrl']
|
314
|
+
@renew = input['renew']
|
315
315
|
|
316
316
|
st, @error = validate_service_ticket(@service, @ticket)
|
317
317
|
@success = st && !@error
|
@@ -337,14 +337,14 @@ module CASServer::Controllers
|
|
337
337
|
|
338
338
|
# 2.6.1
|
339
339
|
def get
|
340
|
-
CASServer::Utils::log_controller_action(self.class,
|
340
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
341
341
|
|
342
342
|
# required
|
343
|
-
@service = clean_service_url(
|
344
|
-
@ticket =
|
343
|
+
@service = clean_service_url(input['service'])
|
344
|
+
@ticket = input['ticket']
|
345
345
|
# optional
|
346
|
-
@pgt_url =
|
347
|
-
@renew =
|
346
|
+
@pgt_url = input['pgtUrl']
|
347
|
+
@renew = input['renew']
|
348
348
|
|
349
349
|
@proxies = []
|
350
350
|
|
@@ -378,11 +378,11 @@ module CASServer::Controllers
|
|
378
378
|
|
379
379
|
# 2.7
|
380
380
|
def get
|
381
|
-
CASServer::Utils::log_controller_action(self.class,
|
381
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
382
382
|
|
383
383
|
# required
|
384
|
-
@ticket =
|
385
|
-
@target_service =
|
384
|
+
@ticket = input['pgt']
|
385
|
+
@target_service = input['targetService']
|
386
386
|
|
387
387
|
pgt, @error = validate_proxy_granting_ticket(@ticket)
|
388
388
|
@success = pgt && !@error
|
@@ -406,7 +406,7 @@ module CASServer::Controllers
|
|
406
406
|
include CASServer::CAS
|
407
407
|
|
408
408
|
def get
|
409
|
-
CASServer::Utils::log_controller_action(self.class,
|
409
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
410
410
|
$LOG.error("Tried to use login ticket dispenser with get method!")
|
411
411
|
@status = 422
|
412
412
|
_("To generate a login ticket, you must make a POST request.")
|
@@ -415,7 +415,7 @@ module CASServer::Controllers
|
|
415
415
|
# Renders a page with a login ticket (and only the login ticket)
|
416
416
|
# in the response body.
|
417
417
|
def post
|
418
|
-
CASServer::Utils::log_controller_action(self.class,
|
418
|
+
CASServer::Utils::log_controller_action(self.class, input)
|
419
419
|
lt = generate_login_ticket
|
420
420
|
|
421
421
|
$LOG.debug("Dispensing login ticket #{lt} to host #{(@env['HTTP_X_FORWARDED_FOR'] || @env['REMOTE_HOST'] || @env['REMOTE_ADDR']).inspect}")
|
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gunark-rubycas-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.0.
|
4
|
+
version: 0.8.0.20090225
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Matt Zukowski
|
7
|
+
- Matt Zukowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-25 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -23,6 +24,7 @@ dependencies:
|
|
23
24
|
version:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
26
|
name: activerecord
|
27
|
+
type: :runtime
|
26
28
|
version_requirement:
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
28
30
|
requirements:
|
@@ -32,6 +34,7 @@ dependencies:
|
|
32
34
|
version:
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
36
|
name: gettext
|
37
|
+
type: :runtime
|
35
38
|
version_requirement:
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
@@ -41,6 +44,7 @@ dependencies:
|
|
41
44
|
version:
|
42
45
|
- !ruby/object:Gem::Dependency
|
43
46
|
name: picnic
|
47
|
+
type: :runtime
|
44
48
|
version_requirement:
|
45
49
|
version_requirements: !ruby/object:Gem::Requirement
|
46
50
|
requirements:
|
@@ -50,6 +54,7 @@ dependencies:
|
|
50
54
|
version:
|
51
55
|
- !ruby/object:Gem::Dependency
|
52
56
|
name: hoe
|
57
|
+
type: :development
|
53
58
|
version_requirement:
|
54
59
|
version_requirements: !ruby/object:Gem::Requirement
|
55
60
|
requirements:
|
@@ -124,12 +129,6 @@ files:
|
|
124
129
|
- lib/themes/urbacon/logo.png
|
125
130
|
- lib/themes/urbacon/theme.css
|
126
131
|
- lib/themes/warning.png
|
127
|
-
- locale/de_DE/LC_MESSAGES/rubycas-server.mo
|
128
|
-
- locale/es_ES/LC_MESSAGES/rubycas-server.mo
|
129
|
-
- locale/fr_FR/LC_MESSAGES/rubycas-server.mo
|
130
|
-
- locale/ja_JP/LC_MESSAGES/rubycas-server.mo
|
131
|
-
- locale/pl_PL/LC_MESSAGES/rubycas-server.mo
|
132
|
-
- locale/ru_RU/LC_MESSAGES/rubycas-server.mo
|
133
132
|
- po/de_DE/rubycas-server.po
|
134
133
|
- po/es_ES/rubycas-server.po
|
135
134
|
- po/fr_FR/rubycas-server.po
|
@@ -137,7 +136,6 @@ files:
|
|
137
136
|
- po/pl_PL/rubycas-server.po
|
138
137
|
- po/ru_RU/rubycas-server.po
|
139
138
|
- po/rubycas-server.pot
|
140
|
-
- public/restart.txt
|
141
139
|
- resources/init.d.sh
|
142
140
|
- script/console
|
143
141
|
- script/destroy
|
@@ -162,6 +160,10 @@ post_install_message: |+
|
|
162
160
|
|
163
161
|
For more information on RubyCAS-Server, see http://code.google.com/p/rubycas-server
|
164
162
|
|
163
|
+
If you plan on using RubyCAS-Server with languages other than English, please cd into the
|
164
|
+
RubyCAS-Server installation directory (where the gem is installed) and type `rake mo` to
|
165
|
+
build the LOCALE_LC files.
|
166
|
+
|
165
167
|
rdoc_options:
|
166
168
|
- --main
|
167
169
|
- README.txt
|