rack-auth-kerberos 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,2 +1,10 @@
1
+ = 0.2.1 - 28-Dec-2009
2
+ * Minor internal refactoring and documentation updates.
3
+
4
+ = 0.2.0 - 19-Dec-2009
5
+ * Several request environment variables are now set. This includes AUTH_TYPE,
6
+ AUTH_TYPE_USER, AUTH_TYPE_THIS_REQUEST and AUTH_DATETIME. See the
7
+ documentation for details.
8
+
1
9
  = 0.1.0 - 11-Dec-2009
2
10
  * Initial release
@@ -4,7 +4,7 @@ module Rack
4
4
  module Auth
5
5
  class Kerberos
6
6
  # The version of the rack-auth-kerberos library.
7
- VERSION = '0.2.0'
7
+ VERSION = '0.2.1'
8
8
 
9
9
  # Creates a new Rack::Kerberos object. The +user_field+ and +password_field+
10
10
  # are the params looked for in the call method. The defaults are 'username'
@@ -44,6 +44,13 @@ module Rack
44
44
  # It is then up to the application to check for the presence of AUTH_USER
45
45
  # and/or AUTH_FAIL and act as necessary.
46
46
  #
47
+ # Several other request environment variables are set on success:
48
+ #
49
+ # AUTH_TYPE => "Kerberos Password"
50
+ # AUTH_TYPE_USER => user + realm
51
+ # AUTH_TYPE_THIS_REQUEST => "Kerberos Password"
52
+ # AUTH_DATETIME => Time.now.utc
53
+ #
47
54
  def call(env)
48
55
  request = Rack::Request.new(env)
49
56
 
@@ -66,14 +73,6 @@ module Rack
66
73
 
67
74
  begin
68
75
  @kerberos.get_init_creds_password(user_with_realm, password)
69
-
70
- env['AUTH_USER'] = user
71
- env['AUTH_TYPE'] = "Kerberos Password"
72
- env['AUTH_TYPE_USER'] = user_with_realm
73
- env['AUTH_TYPE_THIS_REQUEST'] = "Kerberos Password"
74
- env['AUTH_DATETIME'] = Time.now.utc
75
-
76
- env.delete('AUTH_FAIL')
77
76
  rescue Krb5Auth::Krb5::Exception => err
78
77
  case err.message
79
78
  when /client not found/i
@@ -89,6 +88,14 @@ module Rack
89
88
  rescue => err
90
89
  env.delete('AUTH_USER')
91
90
  env['AUTH_FAIL'] = "Unexpected failure during Kerberos authentication"
91
+ else
92
+ env.delete('AUTH_FAIL')
93
+
94
+ env['AUTH_USER'] = user
95
+ env['AUTH_TYPE'] = "Kerberos Password"
96
+ env['AUTH_TYPE_USER'] = user_with_realm
97
+ env['AUTH_TYPE_THIS_REQUEST'] = "Kerberos Password"
98
+ env['AUTH_DATETIME'] = Time.now.utc
92
99
  ensure
93
100
  @kerberos.close
94
101
  end
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'rack-auth-kerberos'
5
- gem.version = '0.2.0'
5
+ gem.version = '0.2.1'
6
6
  gem.authors = ["Daniel Berger", "Charlie O'Keefe"]
7
7
  gem.email = 'dberger@globe.gov'
8
8
  gem.homepage = 'http://www.github.com/rack-kerberos'
@@ -13,7 +13,7 @@ class TC_Rack_Auth_Kerberos < Test::Unit::TestCase
13
13
  end
14
14
 
15
15
  def test_version
16
- assert_equal('0.1.0', Rack::Auth::Kerberos::VERSION)
16
+ assert_equal('0.2.1', Rack::Auth::Kerberos::VERSION)
17
17
  end
18
18
 
19
19
  def teardown
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-auth-kerberos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Berger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-12-19 00:00:00 -07:00
13
+ date: 2009-12-28 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency