rubycas-server 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/CHANGELOG.txt +1 -186
  2. data/History.txt +247 -0
  3. data/Manifest.txt +27 -2
  4. data/PostInstall.txt +3 -0
  5. data/Rakefile +4 -60
  6. data/bin/rubycas-server +2 -2
  7. data/bin/rubycas-server-ctl +0 -0
  8. data/casserver.db +0 -0
  9. data/casserver.log +792 -0
  10. data/casserver_db.log +88 -0
  11. data/config/hoe.rb +76 -0
  12. data/config/requirements.rb +15 -0
  13. data/config.example.yml +130 -6
  14. data/lib/casserver/authenticators/base.rb +20 -0
  15. data/lib/casserver/authenticators/client_certificate.rb +46 -0
  16. data/lib/casserver/authenticators/google.rb +54 -0
  17. data/lib/casserver/authenticators/ldap.rb +70 -40
  18. data/lib/casserver/authenticators/ntlm.rb +88 -0
  19. data/lib/casserver/authenticators/open_id.rb +22 -0
  20. data/lib/casserver/authenticators/sql.rb +66 -1
  21. data/lib/casserver/authenticators/sql_md5.rb +19 -0
  22. data/lib/casserver/authenticators/test.rb +5 -1
  23. data/lib/casserver/cas.rb +97 -22
  24. data/lib/casserver/controllers.rb +95 -34
  25. data/lib/casserver/environment.rb +16 -9
  26. data/lib/casserver/models.rb +38 -10
  27. data/lib/casserver/version.rb +1 -1
  28. data/lib/casserver/views.rb +38 -22
  29. data/lib/casserver.rb +13 -9
  30. data/lib/rubycas-server/version.rb +1 -0
  31. data/lib/rubycas-server.rb +1 -1
  32. data/lib/themes/notice.png +0 -0
  33. data/lib/themes/simple/logo.png +0 -0
  34. data/misc/basic_cas_single_signon_mechanism_diagram.png +0 -0
  35. data/misc/basic_cas_single_signon_mechanism_diagram.svg +652 -0
  36. data/script/console +10 -0
  37. data/script/destroy +14 -0
  38. data/script/generate +14 -0
  39. data/script/txt2html +82 -0
  40. data/tasks/deployment.rake +34 -0
  41. data/tasks/environment.rake +7 -0
  42. data/tasks/website.rake +17 -0
  43. data/website/index.html +40 -0
  44. data/website/index.txt +3 -0
  45. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  46. data/website/stylesheets/screen.css +138 -0
  47. data/website/template.html.erb +40 -0
  48. metadata +45 -33
  49. data/test/test_cas.rb +0 -33
  50. data/test/test_casserver.rb +0 -125
@@ -0,0 +1,40 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ <%= title %>
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1><%= title %></h1>
34
+ <%= body %>
35
+ </div>
36
+
37
+ <!-- insert site tracking codes here, like Google Urchin -->
38
+
39
+ </body>
40
+ </html>
metadata CHANGED
@@ -1,48 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycas-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zukowski
8
- - Jason Zylks
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
11
 
13
- date: 2008-08-21 00:00:00 -04:00
12
+ date: 2008-11-04 00:00:00 -05:00
14
13
  default_executable:
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
- name: activesupport
16
+ name: hoe
17
+ type: :development
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.0
23
+ version: 1.7.0
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: activerecord
27
- version_requirement:
28
- version_requirements: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.15.3
33
- version:
34
- - !ruby/object:Gem::Dependency
35
- name: picnic
36
- version_requirement:
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: 0.6.3
42
- version:
43
- description: Provides single sign on for web applications using the CAS protocol.
25
+ description: Provides single sign-on authentication for web applications using the CAS protocol.
44
26
  email:
45
- - matt at roughest dot net
27
+ - matt@zukowski.ca
46
28
  executables:
47
29
  - rubycas-server
48
30
  - rubycas-server-ctl
@@ -50,25 +32,40 @@ extensions: []
50
32
 
51
33
  extra_rdoc_files:
52
34
  - CHANGELOG.txt
35
+ - History.txt
53
36
  - LICENSE.txt
54
37
  - Manifest.txt
38
+ - PostInstall.txt
55
39
  - README.txt
40
+ - website/index.txt
56
41
  files:
57
42
  - CHANGELOG.txt
43
+ - History.txt
58
44
  - LICENSE.txt
59
45
  - Manifest.txt
46
+ - PostInstall.txt
60
47
  - README.txt
61
48
  - Rakefile
62
49
  - bin/rubycas-server
63
50
  - bin/rubycas-server-ctl
51
+ - casserver.db
52
+ - casserver.log
53
+ - casserver_db.log
64
54
  - config.example.yml
55
+ - config/hoe.rb
56
+ - config/requirements.rb
65
57
  - custom_views.example.rb
66
58
  - lib/casserver.rb
67
59
  - lib/casserver/authenticators/active_directory_ldap.rb
68
60
  - lib/casserver/authenticators/base.rb
61
+ - lib/casserver/authenticators/client_certificate.rb
62
+ - lib/casserver/authenticators/google.rb
69
63
  - lib/casserver/authenticators/ldap.rb
64
+ - lib/casserver/authenticators/ntlm.rb
65
+ - lib/casserver/authenticators/open_id.rb
70
66
  - lib/casserver/authenticators/sql.rb
71
67
  - lib/casserver/authenticators/sql_encrypted.rb
68
+ - lib/casserver/authenticators/sql_md5.rb
72
69
  - lib/casserver/authenticators/test.rb
73
70
  - lib/casserver/cas.rb
74
71
  - lib/casserver/conf.rb
@@ -80,6 +77,7 @@ files:
80
77
  - lib/casserver/version.rb
81
78
  - lib/casserver/views.rb
82
79
  - lib/rubycas-server.rb
80
+ - lib/rubycas-server/version.rb
83
81
  - lib/themes/cas.css
84
82
  - lib/themes/notice.png
85
83
  - lib/themes/ok.png
@@ -92,10 +90,17 @@ files:
92
90
  - lib/themes/urbacon/logo.png
93
91
  - lib/themes/urbacon/theme.css
94
92
  - lib/themes/warning.png
93
+ - misc/basic_cas_single_signon_mechanism_diagram.png
94
+ - misc/basic_cas_single_signon_mechanism_diagram.svg
95
95
  - resources/init.d.sh
96
+ - script/console
97
+ - script/destroy
98
+ - script/generate
99
+ - script/txt2html
96
100
  - setup.rb
97
- - test/test_cas.rb
98
- - test/test_casserver.rb
101
+ - tasks/deployment.rake
102
+ - tasks/environment.rake
103
+ - tasks/website.rake
99
104
  - vendor/isaac_0.9.1/LICENSE
100
105
  - vendor/isaac_0.9.1/README
101
106
  - vendor/isaac_0.9.1/TODO
@@ -104,9 +109,17 @@ files:
104
109
  - vendor/isaac_0.9.1/isaac.gemspec
105
110
  - vendor/isaac_0.9.1/setup.rb
106
111
  - vendor/isaac_0.9.1/test/TC_ISAAC.rb
112
+ - website/index.html
113
+ - website/index.txt
114
+ - website/javascripts/rounded_corners_lite.inc.js
115
+ - website/stylesheets/screen.css
116
+ - website/template.html.erb
107
117
  has_rdoc: true
108
118
  homepage: http://rubycas-server.rubyforge.org
109
- post_install_message:
119
+ post_install_message: |+
120
+
121
+ For more information on RubyCAS-Server, see http://code.google.com/p/rubycas-server
122
+
110
123
  rdoc_options:
111
124
  - --main
112
125
  - README.txt
@@ -127,10 +140,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
140
  requirements: []
128
141
 
129
142
  rubyforge_project: rubycas-server
130
- rubygems_version: 1.0.1
143
+ rubygems_version: 1.2.0
131
144
  signing_key:
132
145
  specification_version: 2
133
- summary: Provides single sign on for web applications using the CAS protocol.
134
- test_files:
135
- - test/test_cas.rb
136
- - test/test_casserver.rb
146
+ summary: Provides single sign-on authentication for web applications using the CAS protocol.
147
+ test_files: []
148
+
data/test/test_cas.rb DELETED
@@ -1,33 +0,0 @@
1
- require 'rubygems'
2
- require 'mosquito'
3
-
4
- $CONF = {:authenticator => {:class => "CASServer::Authenticators::Test"},
5
- :log => {:file => "/tmp/test.log", :level => "INFO"}}
6
-
7
- require File.dirname(__FILE__) + "/../lib/casserver"
8
-
9
- CASServer.create
10
-
11
- class TestCASServer < Camping::UnitTest
12
-
13
- include CASServer::CAS
14
-
15
- def test_generate_proxy_granting_ticket
16
- pgt_url = "https://portal.urbacon.net:6543/cas_proxy_callback/receive_pgt"
17
- st = generate_service_ticket("http://test.foo", "tester")
18
-
19
- pgt = nil
20
-
21
- assert_difference(ProxyGrantingTicket, :count, 1) do
22
- pgt = generate_proxy_granting_ticket(pgt_url, st)
23
- end
24
-
25
- puts pgt.inspect
26
- end
27
-
28
- protected
29
- def env
30
- return {'REMOTE_ADDR' => "TEST"}
31
- end
32
-
33
- end
@@ -1,125 +0,0 @@
1
- require 'rubygems'
2
- require 'mosquito'
3
-
4
- $CONF = {:authenticator => {:class => "CASServer::Authenticators::Test"}}
5
-
6
- require File.dirname(__FILE__) + "/../lib/casserver"
7
-
8
- include CASServer::Models
9
- CASServer.create
10
-
11
- class TestCASServer < Camping::FunctionalTest
12
-
13
- def test_test_atuhenticator
14
- require File.dirname(__FILE__) + "/../lib/casserver/authenticators/test"
15
-
16
- valid_credentials = {:username => "testuser", :password => "testpassword"}
17
- invalid_credentials = {:username => "asdfsdf", :password => "asdfsdf"}
18
-
19
- assert_equal CASServer::Authenticators::Test, $AUTH.class
20
- assert $AUTH.validate(valid_credentials)
21
- assert !$AUTH.validate(invalid_credentials)
22
- end
23
-
24
- def test_valid_login
25
- lt = start_login
26
-
27
- post '/login',
28
- :lt => lt.ticket,
29
- :username => "testuser",
30
- :password => "testpassword"
31
-
32
- assert_match_body("You have successfully logged in")
33
-
34
- lt = LoginTicket.find_by_ticket(lt.ticket)
35
-
36
- assert_not_nil @cookies[:tgt]
37
- assert_not_nil TicketGrantingTicket.find_by_ticket(@cookies[:tgt])
38
-
39
- assert lt.consumed?
40
- end
41
-
42
- def test_valid_login_with_service
43
- lt = start_login
44
-
45
- fake_service = "http://www.google.com/"
46
-
47
- post '/login',
48
- :lt => lt.ticket,
49
- :username => "testuser",
50
- :password => "testpassword",
51
- :service => fake_service
52
-
53
- @response.headers['Location'].to_s =~ /(.*?)\?ticket=(.*)/
54
- redirected_to = $~[1]
55
- service_ticket = $~[2]
56
-
57
- assert_equal fake_service, redirected_to
58
-
59
- assert_not_nil service_ticket
60
- st = ServiceTicket.find_by_ticket(service_ticket)
61
- assert_equal fake_service, st.service
62
- assert_equal "testuser", st.username
63
- assert !st.consumed?
64
-
65
- assert_not_nil @cookies[:tgt]
66
- assert_not_nil TicketGrantingTicket.find_by_ticket(@cookies[:tgt])
67
-
68
- assert LoginTicket.find_by_ticket(lt.ticket).consumed?
69
- end
70
-
71
- def test_invalid_login
72
- lt = start_login
73
-
74
- post '/login',
75
- :lt => lt.ticket,
76
- :username => "testuser",
77
- :password => "badpassword"
78
-
79
- assert_match_body("Incorrect username or password")
80
-
81
- # reusing the same login ticket should fail
82
- post '/login',
83
- :lt => lt.ticket,
84
- :username => "testuser",
85
- :password => "testpassword"
86
-
87
- assert_match_body("The login ticket you provided has already been used up")
88
-
89
- # missing username/password
90
- lt = start_login
91
- post '/login',
92
- :lt => lt.ticket
93
-
94
- assert_match_body("Incorrect username or password")
95
-
96
- # missing login ticket
97
- post '/login',
98
- :username => "testuser",
99
- :password => "testpassword"
100
-
101
- assert_match_body("Your login request did not include a login ticket")
102
- end
103
-
104
- private
105
- def start_login
106
- assert_difference(LoginTicket, :count, 1) do
107
- get '/login'
108
- end
109
-
110
- assert_response :success
111
- assert_match_body("Login")
112
-
113
- @response.body =~ /LT-[a-zA-Z0-9]*/
114
- lt = $~[0]
115
- assert_not_nil lt
116
-
117
- lt = LoginTicket.find_by_ticket(lt)
118
- assert_not_nil lt
119
-
120
- assert !lt.consumed?
121
-
122
- lt
123
- end
124
-
125
- end