bsb_active_directory 8.0 → 45.0

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
  SHA256:
3
- metadata.gz: 55c943d22386d944410840c0ed674d4a0645fb1acb4f1997570e00b3b35294d0
4
- data.tar.gz: 8a0a42aa0feb3481080e7fe159dc0fb493d4d7c00305e5caed39a9178a2ad62b
3
+ metadata.gz: f68a7bf51032093281bf80290907808f681b932915d5167af9948073a5825f44
4
+ data.tar.gz: 149c545656889e13ae71e4800d692392602673d013cdc9529e2a6f2b5cad5c6f
5
5
  SHA512:
6
- metadata.gz: 8e4a33f9f66da3773700551d4aeb59cf53f1620b5dc812f2685cf6672f6f5ab28bfa81177abbe60f72420f23447c73c9bede49f814ad39d6627e425839ba441d
7
- data.tar.gz: fdebcb7178459a5c8d8f122a7193b01cc07e86432e621a10d525747e8167f678d9124be1fbe9c502b76c0d384dcdcbcbc51230b484e52be511e78e01e37e1467
6
+ metadata.gz: dee5165474cb3a4cb5b198038cf39ee582e75749b0e28b21affdd3d7d191e068015012fc2474c5bd66ed761107d25be4c9c1a42ff96c6ea68a73f7ad0e6624b2
7
+ data.tar.gz: 5b4180584fccadb216a7df943cf965cdaae9eb939c0f982389f7e7fd5171c39cea7ee82401764057c6961e4b0b631b89a1faf462de6bfe68d050ec2bc0f974c1
data/README.md CHANGED
@@ -1,43 +1,43 @@
1
- = Active Directory
2
-
3
- Ruby Integration with Microsoft's Active Directory system based on original code by Justin Mecham and James Hunt at http://rubyforge.org/projects/activedirectory
4
-
5
- See documentation on ActiveDirectory::Base for more information.
6
-
7
- Caching:
8
- Queries for membership and group membership are based on the distinguished name of objects. Doing a lot of queries, especially for a Rails app, is a sizable slowdown. To alleviate the problem, I've implemented a very basic cache for queries which search by :distinguishedname. This is disabled by default. All other queries are unaffected.
9
-
10
-
11
- A code example is worth a thousand words:
12
-
13
- <pre>
14
- require 'rubygems'
15
- require 'bsb_active_directory'
16
-
17
- # Uses the same settings as net/ldap
18
- settings = {
19
- :host => 'domain-controller.example.local',
20
- :base => 'dc=example,dc=local',
21
- :port => 636,
22
- :encryption => :simple_tls,
23
- :auth => {
24
- :method => :simple,
25
- :username => "username",
26
- :password => "password"
27
- }
28
- }
29
-
30
- # Basic usage
31
- ActiveDirectory::Base.setup(settings)
32
-
33
- ActiveDirectory::User.find(:all)
34
- ActiveDirectory::User.find(:first, :userprincipalname => "john.smith@domain.com")
35
-
36
- ActiveDirectory::Group.find(:all)
37
-
38
- #Caching is disabled by default, to enable:
39
- ActiveDirectory::Base.enable_cache
40
- ActiveDirectory::Base.disable_cache
41
- ActiveDirectory::Base.cache?
42
-
43
- </pre>
1
+ = Active Directory
2
+
3
+ Ruby Integration with Microsoft's Active Directory system based on original code by Justin Mecham and James Hunt at http://rubyforge.org/projects/activedirectory
4
+
5
+ See documentation on ActiveDirectory::Base for more information.
6
+
7
+ Caching:
8
+ Queries for membership and group membership are based on the distinguished name of objects. Doing a lot of queries, especially for a Rails app, is a sizable slowdown. To alleviate the problem, I've implemented a very basic cache for queries which search by :distinguishedname. This is disabled by default. All other queries are unaffected.
9
+
10
+
11
+ A code example is worth a thousand words:
12
+
13
+ <pre>
14
+ require 'rubygems'
15
+ require 'bsb_active_directory'
16
+
17
+ # Uses the same settings as net/ldap
18
+ settings = {
19
+ :host => 'domain-controller.example.local',
20
+ :base => 'dc=example,dc=local',
21
+ :port => 636,
22
+ :encryption => :simple_tls,
23
+ :auth => {
24
+ :method => :simple,
25
+ :username => "username",
26
+ :password => "password"
27
+ }
28
+ }
29
+
30
+ # Basic usage
31
+ ActiveDirectory::Base.setup(settings)
32
+
33
+ ActiveDirectory::User.find(:all)
34
+ ActiveDirectory::User.find(:first, :userprincipalname => "john.smith@domain.com")
35
+
36
+ ActiveDirectory::Group.find(:all)
37
+
38
+ #Caching is disabled by default, to enable:
39
+ ActiveDirectory::Base.enable_cache
40
+ ActiveDirectory::Base.disable_cache
41
+ ActiveDirectory::Base.cache?
42
+
43
+ </pre>
@@ -180,7 +180,7 @@ module ActiveDirectory
180
180
  #
181
181
  def self.exists?(filter_as_hash)
182
182
  criteria = make_filter_from_hash(filter_as_hash) & filter
183
- @@ldap.search(filter: criteria).!empty?
183
+ !@@ldap.search(filter: criteria).empty?
184
184
  end
185
185
 
186
186
  #
@@ -53,11 +53,11 @@ module ActiveDirectory
53
53
  def self.create_security_group(ou, name, type)
54
54
  type_mask = GroupType::SECURITY_ENABLED
55
55
  case type
56
- when :local
56
+ when 'local'
57
57
  type_mask |= GroupType::RESSOURCE_GROUP
58
- when :global
58
+ when 'global'
59
59
  type_mask |= GroupType::ACCOUNT_GROUP
60
- when :universal
60
+ when 'universal'
61
61
  type_mask |= GroupType::UNIVERSAL_GROUP
62
62
  else
63
63
  raise "Unknown type specified : #{type}"
@@ -66,7 +66,7 @@ module ActiveDirectory
66
66
  attributes = {
67
67
  objectClass: %w[top group],
68
68
  sAMAccountName: name,
69
- objectCategory: 'CN=Group,CN=Schema,CN=Configuration,DC=afssa,DC=fr',
69
+ objectCategory: 'CN=Group,CN=Schema,CN=Configuration,' + settings[:base],
70
70
  groupType: type_mask.to_s
71
71
  }
72
72
  @@ldap.add(dn: dn, attributes: attributes)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsb_active_directory
3
3
  version: !ruby/object:Gem::Version
4
- version: '8.0'
4
+ version: '45.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Arnaud