devise_ldap_multiple 0.9.1 → 0.9.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2ff9186428183eac42c5727d07f36e48047f695
|
4
|
+
data.tar.gz: 90f34efff4ea5b9ca7741dfb70561e1e12bb41b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e7f2525dcbe3e87f8e9c2a0e51c116d822eebb3a0911afba6ebdfaf1155b9cd36a8f349ea6ef90a5f065436bf96a13a119db69ab5a3b1235f71455ba897b6b
|
7
|
+
data.tar.gz: de15791ae32a3ad99de401f5d3d09587b1d01ad20c462bd75a9ba5772c7a8198bfabf6036dd0e6d87da1fc2645e24f5892708c8476fd3e6a58fb55e643cb9108
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'devise_ldap_multiple'
|
7
7
|
s.version = DeviseLdapMultiple::VERSION.dup
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.summary = 'Devise extension to allow authentication to multiple
|
9
|
+
s.summary = 'Devise extension to allow authentication to multiple LDAP servers, or with multiple configurations to the same LDAP server. Fork of the devise_ldap_authenticatable project.'
|
10
10
|
s.email = 'swillett@outlook.com'
|
11
11
|
s.homepage = 'https://github.com/xarael/devise_ldap_multiple'
|
12
12
|
s.description = s.summary
|
data/lib/devise_ldap_multiple.rb
CHANGED
@@ -6,6 +6,12 @@ require 'devise_ldap_multiple/exception'
|
|
6
6
|
require 'devise_ldap_multiple/logger'
|
7
7
|
require 'devise_ldap_multiple/ldap/adapter'
|
8
8
|
require 'devise_ldap_multiple/ldap/connection'
|
9
|
+
require 'devise_ldap_multiple/concern'
|
10
|
+
|
11
|
+
# Open this class to allow myhash to be read (the data in an object of this type is within this instance variable)
|
12
|
+
class Net::LDAP::Entry
|
13
|
+
attr_reader :myhash
|
14
|
+
end
|
9
15
|
|
10
16
|
# Nearly all configuration is in each scope.yml file under config/ldap/ for each scope.
|
11
17
|
module Devise
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# To be included in models
|
2
|
+
|
3
|
+
module DeviseLDAPMultiple
|
4
|
+
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
# Lets you specify a list off attributes to return, and returns them in a hash
|
8
|
+
# If not attributes are specified, all attributes are returned in a hash
|
9
|
+
# (with the exception of some fields which clog up the console since they're huge)
|
10
|
+
def ldap (*options)
|
11
|
+
attributes = {}
|
12
|
+
unless options.empty?
|
13
|
+
options.each do |option|
|
14
|
+
attributes[option] = Devise::LDAP::Adapter.get_ldap_param(self.email, option, self.current_scope).first
|
15
|
+
end
|
16
|
+
else
|
17
|
+
attributes = Devise::LDAP::Adapter.get_ldap_entry(self.email, self.current_scope).myhash.except(:usercertificate).except :thumbnailphoto, :usercertificate, :homemdb, :msexchsafesendershash
|
18
|
+
end
|
19
|
+
attributes
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns the name of the model from the object calling this function
|
23
|
+
def current_scope
|
24
|
+
self.class.name.downcase.split("::").last.to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
# Placeholder for future class methods
|
28
|
+
module ClassMethods
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -11,7 +11,10 @@
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def update_user_model
|
14
|
-
gsub_file "app/models/#{user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable"
|
14
|
+
gsub_file "app/models/#{user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable"
|
15
|
+
inject_into_class "app/models/#{user_model}.rb", user_model.capitalize.constantize do
|
16
|
+
"\n include DeviseLDAPMultiple\n"
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_ldap_multiple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Curtis Schiewek
|
@@ -187,8 +187,9 @@ dependencies:
|
|
187
187
|
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
|
-
description: Devise extension to allow authentication to multiple
|
191
|
-
|
190
|
+
description: Devise extension to allow authentication to multiple LDAP servers, or
|
191
|
+
with multiple configurations to the same LDAP server. Fork of the devise_ldap_authenticatable
|
192
|
+
project.
|
192
193
|
email: swillett@outlook.com
|
193
194
|
executables: []
|
194
195
|
extensions: []
|
@@ -201,6 +202,7 @@ files:
|
|
201
202
|
- Rakefile
|
202
203
|
- devise_ldap_multiple.gemspec
|
203
204
|
- lib/devise_ldap_multiple.rb
|
205
|
+
- lib/devise_ldap_multiple/concern.rb
|
204
206
|
- lib/devise_ldap_multiple/exception.rb
|
205
207
|
- lib/devise_ldap_multiple/ldap/adapter.rb
|
206
208
|
- lib/devise_ldap_multiple/ldap/connection.rb
|
@@ -234,6 +236,7 @@ rubyforge_project:
|
|
234
236
|
rubygems_version: 2.5.1
|
235
237
|
signing_key:
|
236
238
|
specification_version: 4
|
237
|
-
summary: Devise extension to allow authentication to multiple
|
239
|
+
summary: Devise extension to allow authentication to multiple LDAP servers, or with
|
240
|
+
multiple configurations to the same LDAP server. Fork of the devise_ldap_authenticatable
|
238
241
|
project.
|
239
242
|
test_files: []
|