bsb_active_directory 22.0 → 98.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: 6496d956260c7a88507be8baf4e2870099f00818a1f3c9ea238c2f8f80502467
4
- data.tar.gz: c606c85b50688823437428796deda03f4e6cc48bda26329925e6f4648493721f
3
+ metadata.gz: 0de45d1f6c4d883dcf9fb6d43e59b00670622ff383cab036c0d98071929e2b74
4
+ data.tar.gz: 5d550aa3ab3fc509d3d1abc97432e3e635d90fda1aa04a1dd28cc816fcc17cdc
5
5
  SHA512:
6
- metadata.gz: 1c01b7c752f459cf6557c381abf8f5c63dfea6c39ebb3c8ccc2a07f85b3eb03727259b0126ec50b4b566325faf0e1b190a64707d7a89bf89387619308814c99a
7
- data.tar.gz: a78515533f61e79ae1b58676492c96c88c985b935b7355ac088229c9cabe252ee8075eaad6ca1f24aaeb0d74f75a8667fb5242ef3b37303404d986b3b4c05be3
6
+ metadata.gz: 07f9badc2f6575735b4628ef5a4793bd35609b28b24297e25387198aaf52f19e01b3d7ed7e6c4039b201a3021538eef8dcda63d633c57d6a302891be6a3d2e98
7
+ data.tar.gz: 885b54e9b05de4be726f4b021aa336c6672dfd94680807b70b5d7d99c18b4d04476f7cd073a7f43ebdb2e4418eb5399ccf905800cdf29412ebf2b743676b0974
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>
@@ -50,14 +50,14 @@ module ActiveDirectory
50
50
  user.member_of?(self)
51
51
  end
52
52
 
53
- def self.create_security_group(ou, name, type)
53
+ def self.create_security_group(ou, name, type, base)
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,' + 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: '22.0'
4
+ version: '98.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Arnaud