arpitjain11-rubycas-server 0.8.0.20090612

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/CHANGELOG.txt +1 -0
  2. data/History.txt +272 -0
  3. data/LICENSE.txt +504 -0
  4. data/Manifest.txt +85 -0
  5. data/PostInstall.txt +3 -0
  6. data/README.rdoc +26 -0
  7. data/Rakefile +4 -0
  8. data/bin/rubycas-server +13 -0
  9. data/bin/rubycas-server-ctl +9 -0
  10. data/config/hoe.rb +78 -0
  11. data/config/requirements.rb +15 -0
  12. data/config.example.yml +544 -0
  13. data/config.ru +38 -0
  14. data/custom_views.example.rb +11 -0
  15. data/lib/casserver/authenticators/active_directory_ldap.rb +11 -0
  16. data/lib/casserver/authenticators/base.rb +48 -0
  17. data/lib/casserver/authenticators/client_certificate.rb +46 -0
  18. data/lib/casserver/authenticators/google.rb +54 -0
  19. data/lib/casserver/authenticators/ldap.rb +147 -0
  20. data/lib/casserver/authenticators/ntlm.rb +88 -0
  21. data/lib/casserver/authenticators/open_id.rb +22 -0
  22. data/lib/casserver/authenticators/sql.rb +102 -0
  23. data/lib/casserver/authenticators/sql_encrypted.rb +76 -0
  24. data/lib/casserver/authenticators/sql_md5.rb +19 -0
  25. data/lib/casserver/authenticators/sql_rest_auth.rb +77 -0
  26. data/lib/casserver/authenticators/test.rb +19 -0
  27. data/lib/casserver/cas.rb +322 -0
  28. data/lib/casserver/conf.rb +75 -0
  29. data/lib/casserver/controllers.rb +457 -0
  30. data/lib/casserver/load_picnic.rb +19 -0
  31. data/lib/casserver/localization.rb +82 -0
  32. data/lib/casserver/models.rb +265 -0
  33. data/lib/casserver/postambles.rb +174 -0
  34. data/lib/casserver/utils.rb +30 -0
  35. data/lib/casserver/version.rb +9 -0
  36. data/lib/casserver/views.rb +245 -0
  37. data/lib/casserver.rb +58 -0
  38. data/lib/rubycas-server/version.rb +1 -0
  39. data/lib/rubycas-server.rb +1 -0
  40. data/po/de_DE/rubycas-server.po +119 -0
  41. data/po/es_ES/rubycas-server.po +115 -0
  42. data/po/fr_FR/rubycas-server.po +116 -0
  43. data/po/ja_JP/rubycas-server.po +118 -0
  44. data/po/pl_PL/rubycas-server.po +115 -0
  45. data/po/pt_BR/rubycas-server.po +115 -0
  46. data/po/ru_RU/rubycas-server.po +110 -0
  47. data/po/rubycas-server.pot +104 -0
  48. data/public/themes/cas.css +121 -0
  49. data/public/themes/notice.png +0 -0
  50. data/public/themes/ok.png +0 -0
  51. data/public/themes/simple/bg.png +0 -0
  52. data/public/themes/simple/login_box_bg.png +0 -0
  53. data/public/themes/simple/logo.png +0 -0
  54. data/public/themes/simple/theme.css +28 -0
  55. data/public/themes/urbacon/bg.png +0 -0
  56. data/public/themes/urbacon/login_box_bg.png +0 -0
  57. data/public/themes/urbacon/logo.png +0 -0
  58. data/public/themes/urbacon/theme.css +33 -0
  59. data/public/themes/warning.png +0 -0
  60. data/resources/init.d.sh +58 -0
  61. data/script/console +10 -0
  62. data/script/destroy +14 -0
  63. data/script/generate +14 -0
  64. data/script/txt2html +82 -0
  65. data/setup.rb +1585 -0
  66. data/tasks/deployment.rake +34 -0
  67. data/tasks/environment.rake +7 -0
  68. data/tasks/localization.rake +11 -0
  69. data/tasks/website.rake +17 -0
  70. data/vendor/isaac_0.9.1/LICENSE +26 -0
  71. data/vendor/isaac_0.9.1/README +78 -0
  72. data/vendor/isaac_0.9.1/TODO +3 -0
  73. data/vendor/isaac_0.9.1/VERSIONS +3 -0
  74. data/vendor/isaac_0.9.1/crypt/ISAAC.rb +171 -0
  75. data/vendor/isaac_0.9.1/isaac.gemspec +39 -0
  76. data/vendor/isaac_0.9.1/setup.rb +596 -0
  77. data/vendor/isaac_0.9.1/test/TC_ISAAC.rb +76 -0
  78. metadata +193 -0
@@ -0,0 +1,34 @@
1
+ desc 'Release the website and new gem version'
2
+ task :deploy => [:check_version, :website, :release] do
3
+ puts "Remember to create SVN tag:"
4
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
+ puts "Suggested comment:"
7
+ puts "Tagging release #{CHANGES}"
8
+ end
9
+
10
+ desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
+ task :local_deploy => [:website_generate, :install_gem]
12
+
13
+ task :check_version do
14
+ unless ENV['VERSION']
15
+ puts 'Must pass a VERSION=x.y.z release version'
16
+ exit
17
+ end
18
+ unless ENV['VERSION'] == VERS
19
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
20
+ exit
21
+ end
22
+ end
23
+
24
+ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
+ task :install_gem_no_doc => [:clean, :package] do
26
+ sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
+ end
28
+
29
+ namespace :manifest do
30
+ desc 'Recreate Manifest.txt to include ALL files'
31
+ task :refresh do
32
+ `rake check_manifest | patch -p0 > Manifest.txt`
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end
@@ -0,0 +1,11 @@
1
+ desc 'Creates po files'
2
+ task :po do
3
+ require 'gettext/utils'
4
+ GetText.update_pofiles("rubycas-server", Dir.glob("{lib,bin}/**/*.{rb}"), "rubycas-server ")
5
+ end
6
+
7
+ desc 'Creates mo files from po files and puts them to locale dir'
8
+ task :mo do
9
+ require 'gettext/utils'
10
+ GetText.create_mofiles(true, "po", "locale")
11
+ end
@@ -0,0 +1,17 @@
1
+ desc 'Generate website files'
2
+ task :website_generate => :ruby_env do
3
+ (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
4
+ sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
5
+ end
6
+ end
7
+
8
+ desc 'Upload website files to rubyforge'
9
+ task :website_upload do
10
+ host = "#{rubyforge_username}@rubyforge.org"
11
+ remote_dir = "/var/www/gforge-projects/#{PATH}/"
12
+ local_dir = 'website'
13
+ sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
14
+ end
15
+
16
+ desc 'Generate and upload website files'
17
+ task :website => [:website_generate, :website_upload, :publish_docs]
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2004 - 2005 Kirk Haines (khaines@enigo.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ For details about the ISAAC algorithm itself, see:
15
+
16
+ http://burtleburtle.net/bob/rand/isaac.html
17
+
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+
@@ -0,0 +1,78 @@
1
+ Crypt::ISAAC README
2
+ ============
3
+
4
+ ISAAC is a cryptographically secure PRNG for generating high quality random
5
+ numbers. Detailed information about the algorithm can be found at:
6
+
7
+ http://burtleburtle.net/bob/rand/isaac.html
8
+
9
+ This is a pure Ruby implementation of the algorithm. It is reasonably fast for
10
+ a pure Ruby implementation. On an 800Mhz PIII computer running Ruby 1.8.2,
11
+ and while the machine is also serving as general desktop, the library seems to
12
+ consistently generate between 15000 and 16000 random numbers per second.
13
+
14
+ Ruby uses the Mersenne Twister as its PRNG, and while this the Twister is
15
+ a fast PRNG that produces highly random numbers, it is not strong for
16
+ cryptographic purposes, nor is it suitable when one needs multiple
17
+ independent streams of random numbers. Crypt::ISAAC is suitable for either
18
+ purpose.
19
+
20
+
21
+ Requirements
22
+ ------------
23
+
24
+ * Ruby 1.8 (should also run on 1.6.x)
25
+
26
+
27
+ Install
28
+ -------
29
+
30
+ If you have never installed Crypt::ISAAC, you may run the testsuite
31
+ to confirm that it works with:
32
+
33
+ # ruby setup.rb test
34
+
35
+ If you already have a version of Crypt::ISAAC installed, but want to
36
+ confirm this one before installing, run the test suite manually as
37
+ follows:
38
+
39
+ # ruby test/TC_ISAAC.rb local
40
+
41
+ When you are ready to install Crypt::ISAAC, type:
42
+
43
+ # ruby setup.rb install
44
+
45
+ This one step will install Crypt::ISAAC in your Ruby SITELIB. To test
46
+ the library after installation:
47
+
48
+ # ruby setup.rb test
49
+
50
+ Usage
51
+ -----
52
+
53
+ require 'crypt/ISAAC'
54
+
55
+ rng = Crypt::ISAAC.new
56
+
57
+ r1 = rng.rand() # returns a floating point between 0 and 1
58
+ r2 = rnd.rand(1000) # returns an integer between 0 and 999
59
+
60
+ rand() should work identically to the Kernel.rand().
61
+
62
+ Enjoy it. Let me know if you find anything that can be improved or that
63
+ needs to be fixed.
64
+
65
+
66
+ License
67
+ -------
68
+
69
+ The Crypt::ISAAC library is licensed with an MIT style licence.
70
+ See the LICENSE file for details. As for the ISAAC algorithm itself,
71
+ see:
72
+
73
+ http://burtleburtle.net/bob/rand/isaac.html
74
+
75
+
76
+
77
+ Kirk Haines
78
+ khaines@enigo.com
@@ -0,0 +1,3 @@
1
+ * Add a C version of the ISAAC algorithm and make it possible to install
2
+ the pure Ruby version and/or a version using a C extension for better
3
+ performance.
@@ -0,0 +1,3 @@
1
+ * 0.9 Initial public release. Pure Ruby.
2
+ * 0.9.1 Update to tweak a couple things and reorganize project struct.
3
+ Now uses a Package based installer, or can be installed as a gem.
@@ -0,0 +1,171 @@
1
+ module Crypt
2
+
3
+ # ISAAC is a fast, strong random number generator. Details on the
4
+ # algorithm can be found here: http://burtleburtle.net/bob/rand/isaac.html
5
+ # This provides a consistent and capable algorithm for producing
6
+ # independent streams of quality random numbers.
7
+
8
+ class ISAAC
9
+
10
+ attr_accessor :randrsl, :randcnt
11
+ attr_accessor :mm, :aa, :bb, :cc
12
+
13
+ # When a Crypt::ISAAC object is created, it needs to be seeded for
14
+ # random number generation. If the system has a /dev/urandom file,
15
+ # that will be used to do the seeding by default. If false is explictly
16
+ # passed when creating the object, it will instead use /dev/random to
17
+ # generate its seeds. Be warned that this may make for SLOW
18
+ # initialization.
19
+ # If the requested source (/dev/urandom or /dev/random) do not exist,
20
+ # the system will fall back to a simplistic initialization mechanism
21
+ # using the builtin Mersenne Twister PRNG.
22
+
23
+ def initialize(noblock = true)
24
+ @mm = []
25
+ @randrsl = []
26
+ # Best initialization of the generator would be by pulling
27
+ # numbers from /dev/random.
28
+ rnd_source = noblock ? '/dev/urandom' : '/dev/random'
29
+ if (FileTest.exist? rnd_source)
30
+ File.open(rnd_source,'r') do |r|
31
+ 256.times do |t|
32
+ z = r.read(4)
33
+ x = z.unpack('V')[0]
34
+ @randrsl[t] = x
35
+ end
36
+ end
37
+ else
38
+ # If urandom isn't available, the standard Ruby PRNG makes an
39
+ # adequate fallback.
40
+ 256.times do |t|
41
+ @randrsl[t] = Kernel.rand(4294967295)
42
+ end
43
+ end
44
+ randinit(true)
45
+ nil
46
+ end
47
+
48
+ # Works just like the standard rand() function. If called with an
49
+ # integer argument, rand() will return positive random number in
50
+ # the range of 0 to (argument - 1). If called without an integer
51
+ # argument, rand() returns a positive floating point number less than 1.
52
+
53
+ def rand(*num)
54
+ if (@randcnt == 1)
55
+ isaac
56
+ @randcnt = 256
57
+ end
58
+ @randcnt -= 1
59
+ if num[0].to_i > 0
60
+ @randrsl[@randcnt].modulo(num[0])
61
+ else
62
+ ".#{@randrsl[@randcnt]}".to_f
63
+ end
64
+ end
65
+
66
+ def isaac
67
+ i = 0
68
+ x = 0
69
+ y = 0
70
+
71
+ @cc += 1
72
+ @bb += @cc
73
+ @bb & 0xffffffff
74
+
75
+ while (i < 256) do
76
+ x = @mm[i]
77
+ @aa = (@mm[(i + 128) & 255] + (@aa^(@aa << 13)) ) & 0xffffffff
78
+ @mm[i] = y = (@mm[(x>>2)&255] + @aa + @bb ) & 0xffffffff
79
+ @randrsl[i] = @bb = (@mm[(y>>10)&255] + x ) & 0xffffffff
80
+ i += 1
81
+
82
+ x = @mm[i]
83
+ @aa = (@mm[(i+128)&255] + (@aa^(0x03ffffff & (@aa >> 6))) ) & 0xffffffff
84
+ @mm[i] = y = (@mm[(x>>2)&255] + @aa + @bb ) & 0xffffffff
85
+ @randrsl[i] = @bb = (@mm[(y>>10)&255] + x ) & 0xffffffff
86
+ i += 1
87
+
88
+ x = @mm[i]
89
+ @aa = (@mm[(i + 128)&255] + (@aa^(@aa << 2)) ) & 0xffffffff
90
+ @mm[i] = y = (@mm[(x>>2)&255] + @aa + @bb ) & 0xffffffff
91
+ @randrsl[i] = @bb = (@mm[(y>>10)&255] + x ) & 0xffffffff
92
+ i += 1
93
+
94
+ x = @mm[i]
95
+ @aa = (@mm[(i+128)&255] + (@aa^(0x0000ffff & (@aa >> 16))) ) & 0xffffffff
96
+ @mm[i] = y = (@mm[(x>>2)&255] + @aa + @bb ) & 0xffffffff
97
+ @randrsl[i] = @bb = (@mm[(y>>10)&255] + x ) & 0xffffffff
98
+ i += 1
99
+ end
100
+ end
101
+
102
+ def randinit(flag)
103
+ i = 0
104
+ a = 0
105
+ b = 0
106
+ c = 0
107
+ d = 0
108
+ e = 0
109
+ f = 0
110
+ g = 0
111
+ @aa = @bb = @cc = 0
112
+ a = b = c = d = e = f = g = h = 0x9e3779b9
113
+
114
+ while (i < 4) do
115
+ a ^= b<<1; d += a; b += c
116
+ b ^= 0x3fffffff & (c>>2); e += b; c += d
117
+ c ^= d << 8; f += c; d += e
118
+ d ^= 0x0000ffff & (e >> 16); g += d; e += f
119
+ e ^= f << 10; h += e; f += g
120
+ f ^= 0x0fffffff & (g >> 4); a += f; g += h
121
+ g ^= h << 8; b += g; h += a
122
+ h ^= 0x007fffff & (a >> 9); c += h; a += b
123
+ i += 1
124
+ end
125
+
126
+ i = 0
127
+ while (i < 256) do
128
+ if (flag)
129
+ a+=@randrsl[i ].to_i; b+=@randrsl[i+1].to_i;
130
+ c+=@randrsl[i+2]; d+=@randrsl[i+3];
131
+ e+=@randrsl[i+4]; f+=@randrsl[i+5];
132
+ g+=@randrsl[i+6]; h+=@randrsl[i+7];
133
+ end
134
+
135
+ a^=b<<11; d+=a; b+=c;
136
+ b^=0x3fffffff & (c>>2); e+=b; c+=d;
137
+ c^=d<<8; f+=c; d+=e;
138
+ d^=0x0000ffff & (e>>16); g+=d; e+=f;
139
+ e^=f<<10; h+=e; f+=g;
140
+ f^=0x0fffffff & (g>>4); a+=f; g+=h;
141
+ g^=h<<8; b+=g; h+=a;
142
+ h^=0x007fffff & (a>>9); c+=h; a+=b;
143
+ @mm[i]=a;@mm[i+1]=b; @mm[i+2]=c; @mm[i+3]=d;
144
+ @mm[i+4]=e; @mm[i+5]=f; @mm[i+6]=g; @mm[i+7]=h;
145
+ i += 8
146
+ end
147
+
148
+ if flag
149
+ i = 0
150
+ while (i < 256)
151
+ a+=@mm[i ]; b+=@mm[i+1]; c+=@mm[i+2]; d+=@mm[i+3];
152
+ e+=@mm[i+4]; f+=@mm[i+5]; g+=@mm[i+6]; h+=@mm[i+7];
153
+ a^=b<<11; d+=a; b+=c;
154
+ b^=0x3fffffff & (c>>2); e+=b; c+=d;
155
+ c^=d<<8; f+=c; d+=e;
156
+ d^=0x0000ffff & (e>>16); g+=d; e+=f;
157
+ e^=f<<10; h+=e; f+=g;
158
+ f^=0x0fffffff & (g>>4); a+=f; g+=h;
159
+ g^=h<<8; b+=g; h+=a;
160
+ h^=0x007fffff & (a>>9); c+=h; a+=b;
161
+ @mm[i ]=a; @mm[i+1]=b; @mm[i+2]=c; @mm[i+3]=d;
162
+ @mm[i+4]=e; @mm[i+5]=f; @mm[i+6]=g; @mm[i+7]=h;
163
+ i += 8
164
+ end
165
+ end
166
+
167
+ isaac()
168
+ @randcnt=256; # /* prepare to use the first set of results */
169
+ end
170
+ end
171
+ end
@@ -0,0 +1,39 @@
1
+ #####
2
+ # Crypt::ISAAC
3
+ # http://rubyforge.org/projects/crypt-isaac/
4
+ # Copyright 2004-2005 Kirk Haines
5
+ #
6
+ # Licensed under the Ruby License. See the README for details.
7
+ #
8
+ #####
9
+
10
+ spec = Gem::Specification.new do |s|
11
+ s.name = 'Crypt::ISAAC'
12
+ s.version = '0.9.1'
13
+ s.summary = %q(Ruby implementation of the ISAAC PRNG)
14
+ s.platform = Gem::Platform::RUBY
15
+
16
+ s.has_rdoc = true
17
+ s.rdoc_options = %w(--title Crypt::ISAAC --main README --line-numbers)
18
+ s.extra_rdoc_files = %w(README)
19
+
20
+ s.files = %w(README LICENSE TODO VERSIONS setup.rb isaac.gemspec test/TC_ISAAC.rb crypt/ISAAC.rb)
21
+
22
+ s.test_files = ['test/TC_ISAAC.rb']
23
+
24
+ s.require_paths = %w(crypt)
25
+
26
+ s.author = %q(Kirk Haines)
27
+ s.email = %q(khaines@enigo.com)
28
+ s.rubyforge_project = %q(crypt-isaac)
29
+ s.homepage = %q(http://rubyforge.org/projects/crypt-isaac)
30
+ description = []
31
+ File.open("README") do |file|
32
+ file.each do |line|
33
+ line.chomp!
34
+ break if line.empty?
35
+ description << "#{line.gsub(/\[\d\]/, '')}"
36
+ end
37
+ end
38
+ s.description = description[1..-1].join(" ")
39
+ end