devise_ldap_authenticatable 0.1.6 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,134 +1,87 @@
1
- Devise LDAP Authenticatable - Based on Devise-Imapable
2
- =================
1
+ Devise LDAP Authenticatable
2
+ ===========================
3
3
 
4
4
  Devise LDAP Authenticatable is a LDAP based authentication strategy for the [Devise](http://github.com/plataformatec/devise) authentication framework.
5
5
 
6
6
  If you are building applications for use within your organization which require authentication and you want to use LDAP, this plugin is for you.
7
7
 
8
+ For a screencast with an example application, please visit: [http://random-rails.blogspot.com/2010/07/ldap-authentication-with-devise.html](http://random-rails.blogspot.com/2010/07/ldap-authentication-with-devise.html)
9
+
8
10
  Requirements
9
11
  ------------
10
12
 
11
- - Rails 2.3.5
12
- - Devise 1.0.6
13
- - Net-LDAP 0.1.1
14
-
15
- **_Please Note_**
16
-
17
- You must use the net-ldap gem and _NOT_ the ruby-net-ldap gem.
13
+ - An LDAP server (tested on OpenLDAP)
14
+ - Rails 3.0.0.beta4
15
+ - Devise 1.1.rc2
16
+ - ruby-net-ldap 0.0.4
18
17
 
19
18
  Installation
20
19
  ------------
21
20
 
22
- gem install devise_ldap_authenticatable
23
-
24
- and
25
-
26
- config.gem 'devise_ldap_authenticatable'
27
-
28
- Setup
29
- -----
30
-
31
- Once devise\_ldap\_authenticatable is installed, all you need to do is setup the user model which includes a small addition to the model itself and to the schema.
32
-
33
- First the schema :
34
-
35
- create_table :users do |t|
36
- t.ldap_authenticatable, :null => false
37
- end
38
-
39
- and indexes (optional) :
21
+ **_Please Note_**
40
22
 
41
- add_index :login, :unique => true
23
+ This will versions 0.3.0 and above will only work for Rails 3 applications. Please use version 0.2.x for Rails 2 apps.
42
24
 
43
- and don’t forget to migrate :
25
+ In the Gemfile for your application:
44
26
 
45
- rake db:migrate.
27
+ gem "devise", "1.1.rc2"
28
+ gem "devise_ldap_authenticatable"
46
29
 
47
- then the model :
30
+ Setup
31
+ -----
48
32
 
49
- class User < ActiveRecord::Base
50
- devise :ldap_authenticatable, :rememberable, :trackable, :timeoutable
33
+ Run the rails generator
51
34
 
52
- # Setup accessible (or protected) attributes for your model
53
- attr_accessible :login, :ldap_attributes, :password, :remember_me
54
- ...
55
- end
35
+ rails generate devise_ldap_authenticatable:install
56
36
 
57
- and finally change the authentication key in the devise initializer :
37
+ This will install the sample.yml, update the devise.rb initializer, and update your user model. There are some options you can pass to it:
58
38
 
59
- Devise.setup do |config|
60
- ...
61
- config.authentication_keys = [ :login ]
62
- ...
63
- end
39
+ [--user-model=USER_MODEL] # Model to update
40
+ # Default: user
41
+ [--update-model] # Update model to change from database_authenticatable to ldap_authenticatable
42
+ # Default: true
64
43
 
65
- The string stored in ldap_attributes will be inserted between the login and base to provide the full dn used to bind.
66
- I recommend using :rememberable, :trackable, :timeoutable as it gives a full feature set for logins.
67
44
 
68
45
  Usage
69
46
  -----
70
47
 
71
- Devise LDAP Authenticatable works in replacement of Authenticatable,
72
- but because we have to change the authentication\_keys, you'll need to run:
73
-
74
- script/generate devise_views
75
-
76
- and customize your login pages to use :login, instead of :email.
77
-
78
- ------------------------------------------------------------
48
+ Devise LDAP Authenticatable works in replacement of Database Authenticatable
79
49
 
80
50
  **_Please Note_**
81
51
 
82
- This devise plugin has not been tested with Authenticatable enabled at the same time. This is meant as a drop in replacement for Authenticatable allowing for a semi single sign on approach.
52
+ This devise plugin has not been tested with DatabaseAuthenticatable enabled at the same time. This is meant as a drop in replacement for DatabaseAuthenticatable allowing for a semi single sign on approach.
83
53
 
84
54
 
85
55
  Configuration
86
- ----------------------
56
+ -------------
87
57
 
88
58
  In initializer `config/initializers/devise.rb` :
89
59
 
90
- Devise.setup do |config|
91
- # Required
92
- config.ldap_host = 'ldap.mydomain.com'
93
- config.ldap_port = 389
94
- config.ldap_base_dn = 'ou=People,dc=local'
95
- config.ldap_login_attribute = 'uid'
96
-
97
- # Optional, these will default to false or nil if not set
98
- config.ldap_ssl = true
99
- config.ldap_create_user = true
100
- end
101
-
102
- * ldap\_host
103
- * The host of your LDAP server
104
-
105
- * ldap\_port
106
- * The port your LDAP service is listening on.
107
-
108
- * ldap\_base_dn
109
- * The DN that is appended to the login before the LDAP bind is performed.
110
-
111
- * ldap\_login_attribute
112
- * The attribute that is prepended to the login and the base dn to form the
113
- full DN that is used for the bind.
114
- * Example:
115
- * config.ldap\_base_dn = 'ou=People,dc=local'
116
- * config.ldap\_login_attribute = 'uid'
117
- * So when trying to login with 'admin' for example, 'admin' would be
118
- the value stored in login field, but the actual DN used for the bind
119
- would be 'uid=admin,ou=People,dc=local'
120
-
121
- * ldap\_ssl
122
- * Enables SSL (ldaps) encryption. START_TLS encryption will be added when the net-ldap gem adds support for it.
123
-
124
60
  * ldap\_create\_user
125
61
  * If set to true, all valid LDAP users will be allowed to login and an appropriate user record will be created.
126
62
  If set to false, you will have to create the user record before they will be allowed to login.
127
63
 
64
+ * ldap\_config
65
+ * Where to find the LDAP config file. Commented out to use the default, change if needed.
66
+
67
+ * ldap\_update\_password
68
+ * When doing password resets, if true will update the LDAP server. Requires admin password in the ldap.yml
69
+
70
+ Testing
71
+ -------
72
+
73
+ This has been tested using the following setup:
74
+
75
+ * Mac OSX 10.6
76
+ * OpenLDAP 2.4.11
77
+ * REE 1.8.7 (2010.02)
78
+
79
+ All unit and functional tests are part of a sample rails application under test/rails_app and requires a working LDAP sever. There are config files and setup instructions under test/ldap
128
80
 
129
81
  References
130
82
  ----------
131
83
 
84
+ * [Original Plugin](http://github.com/cschiewek/devise_ldap_authenticatable)
132
85
  * [Devise](http://github.com/plataformatec/devise)
133
86
  * [Warden](http://github.com/hassox/warden)
134
87
 
@@ -136,9 +89,8 @@ References
136
89
  TODO
137
90
  ----
138
91
 
139
- - Add support for defining DN format to make logins cleaner
140
- - Tests
92
+ View on [Pivotal Tracker](http://www.pivotaltracker.com/projects/97318).
141
93
 
142
94
  Released under the MIT license
143
95
 
144
- Copyright (c) 2010 Curtis Schiewek
96
+ Copyright (c) 2010 Curtis Schiewek, Daniel McNevin
@@ -5,35 +5,23 @@ require 'devise_ldap_authenticatable/schema'
5
5
  require 'devise_ldap_authenticatable/ldap_adapter'
6
6
  require 'devise_ldap_authenticatable/routes'
7
7
 
8
+ # Get ldap information from config/ldap.yml now
8
9
  module Devise
9
- # host
10
- mattr_accessor :ldap_host
11
- @@ldap_host = nil
12
-
13
- # port
14
- mattr_accessor :ldap_port
15
- @@ldap_port = nil
16
-
17
- # Base DN
18
- mattr_accessor :ldap_base_dn
19
- @@ldap_base_dn = nil
20
-
21
- # Attribute for login
22
- mattr_accessor :ldap_login_attribute
23
- @@ldap_login_attribute = nil
24
-
25
- # Use SSL
26
- mattr_accessor :ldap_ssl
27
- @@ldap_ssl = false
28
-
29
10
  # Add valid users to database
30
11
  mattr_accessor :ldap_create_user
31
12
  @@ldap_create_user = false
13
+
14
+ mattr_accessor :ldap_config
15
+ # @@ldap_config = "#{Rails.root}/config/ldap.yml"
16
+
17
+ mattr_accessor :ldap_update_password
18
+ @@ldap_update_password = true
32
19
  end
33
20
 
34
21
  # Add ldap_authenticatable strategy to defaults.
35
22
  #
36
23
  Devise.add_module(:ldap_authenticatable,
24
+ :route => :session, ## This will add the routes, rather than in the routes.rb
37
25
  :strategy => true,
38
26
  :controller => :sessions,
39
27
  :model => 'devise_ldap_authenticatable/model')
@@ -5,21 +5,66 @@ module Devise
5
5
  # simple adapter for ldap credential checking
6
6
  # ::Devise.ldap_host
7
7
  module LdapAdapter
8
+
9
+ def self.valid_credentials?(login, password_plaintext)
10
+ resource = LdapConnect.new
11
+ ldap = resource.ldap
12
+ ldap.auth "#{resource.attribute}=#{login},#{ldap.base}", password_plaintext
13
+ ldap.bind # will return false if authentication is NOT successful
14
+ end
15
+
16
+ def self.update_password(login, plaintext_password)
17
+ resource = LdapConnect.new
18
+ resource.update_ldap(login, :userpassword => Net::LDAP::Password.generate(:sha, plaintext_password)) if plaintext_password.present?
19
+ end
20
+
21
+ class LdapConnect
8
22
 
9
- def self.valid_credentials?(login, attributes, password)
10
- login = "#{::Devise.ldap_login_attribute}=#{login},"
11
- login += "#{attributes}," unless attributes.nil?
12
- login += ::Devise.ldap_base_dn
13
- @encryption = ::Devise.ldap_ssl ? :simple_tls : nil
14
- ldap = Net::LDAP.new(:encryption => @encryption)
15
- ldap.host = ::Devise.ldap_host
16
- ldap.port = ::Devise.ldap_port
17
- ldap.auth login, password
18
- if ldap.bind
19
- true
20
- else
21
- false
23
+ attr_reader :ldap, :base, :attribute
24
+
25
+ def initialize(params = {})
26
+ ldap_config = YAML.load_file(::Devise.ldap_config || "#{Rails.root}/config/ldap.yml")[Rails.env]
27
+ ldap_options = params
28
+ ldap_options[:encryption] = :simple_tls if ldap_config["ssl"]
29
+
30
+ @ldap = Net::LDAP.new(ldap_options)
31
+ @ldap.host = ldap_config["host"]
32
+ @ldap.port = ldap_config["port"]
33
+ @ldap.base = ldap_config["base"]
34
+ @attribute = ldap_config["attribute"]
35
+ @ldap.auth ldap_config["admin_user"], ldap_config["admin_password"] if params[:admin]
22
36
  end
37
+
38
+ def dn(login)
39
+ "#{@attribute}=#{login},#{@ldap.base}"
40
+ end
41
+
42
+ def update_ldap(login,ops)
43
+ operations = []
44
+ if ops.is_a? Hash
45
+ ops.each do |key,value|
46
+ operations << [:replace,key,value]
47
+ end
48
+ elsif ops.is_a? Array
49
+ operations = ops
50
+ end
51
+
52
+ ldap = LdapConnect.new(:admin => true).ldap
53
+ ldap.bind
54
+
55
+ ldap.modify(:dn => dn(login), :operations => operations)
56
+ end
57
+
58
+ # ## This is for testing, It will clear all users out of the LDAP database. Useful to put in before hooks in rspec, cucumber, etc..
59
+ # def clear_users!(base = @ldap.base)
60
+ # raise "You should ONLY do this on the test enviornment! It will clear out all of the users in the LDAP server" if Rails.env != "test"
61
+ # if @ldap.bind
62
+ # @ldap.search(:filter => "#{@attribute}=*", :base => base) do |entry|
63
+ # @ldap.delete(:dn => entry.dn)
64
+ # end
65
+ # end
66
+ # end
67
+
23
68
  end
24
69
 
25
70
  end
@@ -10,58 +10,61 @@ module Devise
10
10
  # User.find(1).valid_password?('password123') # returns true/false
11
11
  #
12
12
  module LdapAuthenticatable
13
- def self.included(base)
14
- base.class_eval do
15
- extend ClassMethods
13
+ extend ActiveSupport::Concern
16
14
 
17
- attr_accessor :password
15
+ included do
16
+ attr_reader :password, :current_password
17
+ attr_accessor :password_confirmation
18
+ end
19
+
20
+ def password=(new_password)
21
+ @password = new_password
22
+
23
+ if @password.present?
24
+ Devise::LdapAdapter.update_password(self.email, password) if ::Devise.ldap_update_password
18
25
  end
19
26
  end
20
27
 
21
- # Set password to nil
22
28
  def clean_up_passwords
23
- self.password = nil
29
+ # self.password = nil
24
30
  end
25
31
 
26
32
  # Checks if a resource is valid upon authentication.
27
33
  def valid_ldap_authentication?(password)
28
- Devise::LdapAdapter.valid_credentials?(self.login, self.ldap_attributes, password)
34
+ Devise::LdapAdapter.valid_credentials?(self.email, password)
29
35
  end
30
36
 
31
37
  module ClassMethods
32
38
  # Authenticate a user based on configured attribute keys. Returns the
33
39
  # authenticated user if it's valid or nil.
34
40
  def authenticate_with_ldap(attributes={})
35
- return unless attributes[:login].present?
36
- conditions = attributes.slice(:login)
41
+ return unless attributes[:email].present?
42
+ conditions = attributes.slice(:email)
37
43
 
38
- unless conditions[:login]
39
- conditions[:login] = "#{conditions[:login]}"
44
+ unless conditions[:email]
45
+ conditions[:email] = "#{conditions[:email]}"
40
46
  end
41
47
 
42
48
  resource = find_for_ldap_authentication(conditions)
43
- resource = new(conditions) if (resource.nil? and ::Devise.ldap_create_user)
49
+
50
+ if (resource.blank? and ::Devise.ldap_create_user)
51
+ resource = new(conditions.merge({:password => attributes[:password]}))
52
+ end
44
53
 
45
54
  if resource.try(:valid_ldap_authentication?, attributes[:password])
46
- resource.new_record? ? create(conditions) : resource
55
+ resource.new_record? ? resource.save : resource
56
+ else
57
+ nil
47
58
  end
59
+
48
60
  end
49
61
 
50
- protected
62
+ protected
51
63
 
52
- # Find first record based on conditions given (ie by the sign in form).
53
- # Overwrite to add customized conditions, create a join, or maybe use a
54
- # namedscope to filter records while authenticating.
55
- # Example:
56
- #
57
- # def self.find_for_imap_authentication(conditions={})
58
- # conditions[:active] = true
59
- # find(:first, :conditions => conditions)
60
- # end
61
- #
62
64
  def find_for_ldap_authentication(conditions)
63
- find(:first, :conditions => conditions)
65
+ scoped.where(conditions).first
64
66
  end
67
+
65
68
  end
66
69
  end
67
70
  end
@@ -1,6 +1,8 @@
1
- ActionController::Routing::RouteSet::Mapper.class_eval do
1
+ ## No routes needed anymore since Devise.add_module with the :route parameter will take care of it.
2
2
 
3
- protected
4
- # reuse the session routes and controller
5
- alias :ldap_authenticatable :database_authenticatable
6
- end
3
+ # ActionController::Routing::RouteSet::Mapper.class_eval do
4
+ #
5
+ # protected
6
+ # # reuse the session routes and controller
7
+ # alias :ldap_authenticatable :database_authenticatable
8
+ # end
@@ -1,13 +1,14 @@
1
- Devise::Schema.class_eval do
2
- # Creates login
3
- #
4
- # == Options
5
- # * :null - When true, allow columns to be null.
6
- def ldap_authenticatable(options={})
7
- null = options[:null] || false
1
+ ## Using email now instead of login. Will add an option later on.
8
2
 
9
- apply_schema :login, String, :null => false
10
- apply_schema :ldap_attributes, String, :null => true
11
- end
12
-
13
- end
3
+ # Devise::Schema.class_eval do
4
+ # # Creates login
5
+ # #
6
+ # # == Options
7
+ # # * :null - When true, allow columns to be null.
8
+ # def ldap_authenticatable(options={})
9
+ # null = options[:null] || false
10
+ #
11
+ # apply_schema :login, String, :null => null
12
+ # end
13
+ #
14
+ # end
@@ -1,10 +1,10 @@
1
- require 'devise/strategies/base'
1
+ require 'devise/strategies/authenticatable'
2
2
 
3
3
  module Devise
4
4
  module Strategies
5
5
  # Strategy for signing in a user based on his login and password using LDAP.
6
6
  # Redirects to sign_in page if it's not authenticated
7
- class LdapAuthenticatable < Base
7
+ class LdapAuthenticatable < Authenticatable
8
8
  def valid?
9
9
  valid_controller? && valid_params? && mapping.to.respond_to?(:authenticate_with_ldap)
10
10
  end
@@ -23,7 +23,7 @@ module Devise
23
23
  protected
24
24
 
25
25
  def valid_controller?
26
- params[:controller] == 'sessions'
26
+ params[:controller] == 'devise/sessions'
27
27
  end
28
28
 
29
29
  def valid_params?
@@ -0,0 +1,3 @@
1
+ module DeviseLdapAuthenticatable
2
+ VERSION = "0.3.3"
3
+ end
@@ -0,0 +1,33 @@
1
+ module DeviseLdapAuthenticatable
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+
5
+ class_option :user_model, :type => :string, :default => "user", :desc => "Model to update"
6
+ class_option :update_model, :type => :boolean, :default => true, :desc => "Update model to change from database_authenticatable to ldap_authenticatable"
7
+
8
+ def create_ldap_config
9
+ copy_file "ldap.yml", "config/ldap.yml"
10
+ end
11
+
12
+ def create_default_devise_settings
13
+ inject_into_file "config/initializers/devise.rb", default_devise_settings, :after => "Devise.setup do |config|\n"
14
+ end
15
+
16
+ def update_user_model
17
+ gsub_file "app/models/#{options.user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable" if options.update_model?
18
+ end
19
+
20
+ private
21
+
22
+ def default_devise_settings
23
+ <<-eof
24
+ # ==> LDAP Configuration
25
+ # config.ldap_create_user = false
26
+ # config.ldap_update_password = true
27
+ # config.ldap_config = "\#{Rails.root}/config/ldap.yml"
28
+
29
+ eof
30
+ end
31
+
32
+ end
33
+ end
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_ldap_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
- - 1
9
- - 6
10
- version: 0.1.6
7
+ - 3
8
+ - 3
9
+ version: 0.3.3
11
10
  platform: ruby
12
11
  authors:
12
+ - Daneil McNevin
13
13
  - Curtis Schiewek
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-22 00:00:00 -04:00
18
+ date: 2010-07-12 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,62 +24,57 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">"
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 31
30
29
  segments:
31
30
  - 1
32
- - 0
33
- - 4
34
- version: 1.0.4
31
+ - 1
32
+ - rc2
33
+ version: 1.1.rc2
35
34
  type: :runtime
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
38
- name: net-ldap
37
+ name: ruby-net-ldap
39
38
  prerelease: false
40
39
  requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
- - - ">="
42
+ - - ~>
44
43
  - !ruby/object:Gem::Version
45
- hash: 31
46
44
  segments:
47
45
  - 0
48
46
  - 0
49
- - 0
50
- version: 0.0.0
47
+ - 4
48
+ version: 0.0.4
51
49
  type: :runtime
52
50
  version_requirements: *id002
53
- description: LDAP authentication module for Devise
54
- email: curtis.schiewek@gmail.com
51
+ description: LDAP Authentication for Devise
52
+ email:
53
+ - - dpmcnevin@gmail.com
54
+ - - curtis.schiewek@gmail.com
55
55
  executables: []
56
56
 
57
57
  extensions: []
58
58
 
59
- extra_rdoc_files:
60
- - README.md
59
+ extra_rdoc_files: []
60
+
61
61
  files:
62
- - MIT-LICENSE
63
- - README.md
64
- - Rakefile
65
- - VERSION
66
- - devise_ldap_authenticatable.gemspec
67
- - lib/devise_ldap_authenticatable.rb
68
62
  - lib/devise_ldap_authenticatable/ldap_adapter.rb
69
63
  - lib/devise_ldap_authenticatable/model.rb
70
64
  - lib/devise_ldap_authenticatable/routes.rb
71
65
  - lib/devise_ldap_authenticatable/schema.rb
72
66
  - lib/devise_ldap_authenticatable/strategy.rb
73
- - rails/init.rb
74
- - test/devise_ldap_authenticatable_test.rb
75
- - test/test_helper.rb
67
+ - lib/devise_ldap_authenticatable/version.rb
68
+ - lib/devise_ldap_authenticatable.rb
69
+ - lib/generators/devise_ldap_authenticatable/install_generator.rb
70
+ - README.md
76
71
  has_rdoc: true
77
72
  homepage: http://github.com/cschiewek/devise_ldap_authenticatable
78
73
  licenses: []
79
74
 
80
75
  post_install_message:
81
- rdoc_options:
82
- - --charset=UTF-8
76
+ rdoc_options: []
77
+
83
78
  require_paths:
84
79
  - lib
85
80
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -87,7 +82,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
82
  requirements:
88
83
  - - ">="
89
84
  - !ruby/object:Gem::Version
90
- hash: 3
91
85
  segments:
92
86
  - 0
93
87
  version: "0"
@@ -96,17 +90,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
90
  requirements:
97
91
  - - ">="
98
92
  - !ruby/object:Gem::Version
99
- hash: 3
100
93
  segments:
101
- - 0
102
- version: "0"
94
+ - 1
95
+ - 3
96
+ - 6
97
+ version: 1.3.6
103
98
  requirements: []
104
99
 
105
- rubyforge_project:
100
+ rubyforge_project: devise_ldap_authenticatable
106
101
  rubygems_version: 1.3.7
107
102
  signing_key:
108
103
  specification_version: 3
109
- summary: LDAP authentication module for Devise
110
- test_files:
111
- - test/devise_ldap_authenticatable_test.rb
112
- - test/test_helper.rb
104
+ summary: LDAP Authentication for Devise
105
+ test_files: []
106
+
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 Curtis Schiewek
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
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,41 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
-
5
- desc 'Default: run unit tests.'
6
- task :default => :test
7
-
8
- desc 'Test the devise_imapable plugin.'
9
- Rake::TestTask.new(:test) do |t|
10
- t.libs << 'lib'
11
- t.libs << 'test'
12
- t.pattern = 'test/**/*_test.rb'
13
- t.verbose = true
14
- end
15
-
16
- desc 'Generate documentation for the devise_ldap_authenticatable plugin.'
17
- Rake::RDocTask.new(:rdoc) do |rdoc|
18
- rdoc.rdoc_dir = 'rdoc'
19
- rdoc.title = 'DeviseLDAPAuthenticatable'
20
- rdoc.options << '--line-numbers' << '--inline-source'
21
- rdoc.rdoc_files.include('README')
22
- rdoc.rdoc_files.include('lib/**/*.rb')
23
- end
24
-
25
-
26
- begin
27
- require 'jeweler'
28
- Jeweler::Tasks.new do |gemspec|
29
- gemspec.name = "devise_ldap_authenticatable"
30
- gemspec.summary = "LDAP authentication module for Devise"
31
- gemspec.description = "LDAP authentication module for Devise"
32
- gemspec.email = "curtis.schiewek@gmail.com"
33
- gemspec.homepage = "http://github.com/cschiewek/devise_ldap_authenticatable"
34
- gemspec.authors = ["Curtis Schiewek"]
35
- gemspec.add_runtime_dependency "devise", "> 1.0.4"
36
- gemspec.add_runtime_dependency "net-ldap", ">= 0.0.0"
37
- end
38
- Jeweler::GemcutterTasks.new
39
- rescue LoadError
40
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
41
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.6
@@ -1,60 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{devise_ldap_authenticatable}
8
- s.version = "0.1.6"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Curtis Schiewek"]
12
- s.date = %q{2010-07-22}
13
- s.description = %q{LDAP authentication module for Devise}
14
- s.email = %q{curtis.schiewek@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README.md"
17
- ]
18
- s.files = [
19
- "MIT-LICENSE",
20
- "README.md",
21
- "Rakefile",
22
- "VERSION",
23
- "devise_ldap_authenticatable.gemspec",
24
- "lib/devise_ldap_authenticatable.rb",
25
- "lib/devise_ldap_authenticatable/ldap_adapter.rb",
26
- "lib/devise_ldap_authenticatable/model.rb",
27
- "lib/devise_ldap_authenticatable/routes.rb",
28
- "lib/devise_ldap_authenticatable/schema.rb",
29
- "lib/devise_ldap_authenticatable/strategy.rb",
30
- "rails/init.rb",
31
- "test/devise_ldap_authenticatable_test.rb",
32
- "test/test_helper.rb"
33
- ]
34
- s.homepage = %q{http://github.com/cschiewek/devise_ldap_authenticatable}
35
- s.rdoc_options = ["--charset=UTF-8"]
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.7}
38
- s.summary = %q{LDAP authentication module for Devise}
39
- s.test_files = [
40
- "test/devise_ldap_authenticatable_test.rb",
41
- "test/test_helper.rb"
42
- ]
43
-
44
- if s.respond_to? :specification_version then
45
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
46
- s.specification_version = 3
47
-
48
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
- s.add_runtime_dependency(%q<devise>, ["> 1.0.4"])
50
- s.add_runtime_dependency(%q<net-ldap>, [">= 0.0.0"])
51
- else
52
- s.add_dependency(%q<devise>, ["> 1.0.4"])
53
- s.add_dependency(%q<net-ldap>, [">= 0.0.0"])
54
- end
55
- else
56
- s.add_dependency(%q<devise>, ["> 1.0.4"])
57
- s.add_dependency(%q<net-ldap>, [">= 0.0.0"])
58
- end
59
- end
60
-
@@ -1,2 +0,0 @@
1
- # Include hook code here
2
- require 'devise_ldap_authenticatable'
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DeviseLdapAuthenticatableTest < ActiveSupport::TestCase
4
- # Replace this with your real tests.
5
- test "the truth" do
6
- assert true
7
- end
8
- end
@@ -1,3 +0,0 @@
1
- require 'rubygems'
2
- require 'active_support'
3
- require 'active_support/test_case'