cratus 0.2.7 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cratus/config.rb +3 -1
- data/lib/cratus/group.rb +5 -1
- data/lib/cratus/user.rb +5 -1
- data/lib/cratus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d6cd2098f290cd437c360a020a63076bdb4f4ab
|
4
|
+
data.tar.gz: 3f6f590b882dde7cc1b697ec2f9ae0458c5de912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3650be4d866124d7016f1030a49b6314b57b339de99cfc16ab93c9af50162b4ee05ba564b7c9c2a05a3db0763ae51d61df2d126e307d5328786e88c1e9ee76e7
|
7
|
+
data.tar.gz: 3416b42866c6455682b1e31a9cc7d310bd2ee5734346425c68e61d9950794eb55adf97a487d05a4714cd7678495499addd4d0a29ef3051bfe3dd1dbc6a21bc1e
|
data/lib/cratus/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Cratus
|
2
2
|
# A generic way of constructing a mergeable configuration
|
3
|
+
# rubocop:disable Metrics/MethodLength
|
3
4
|
class Config < OpenStruct
|
4
5
|
# A Hash of the default configuration options
|
5
6
|
def defaults
|
@@ -21,7 +22,8 @@ module Cratus
|
|
21
22
|
host: 'ldap.example.com', port: 389,
|
22
23
|
basedn: 'dc=example,dc=com',
|
23
24
|
username: 'username',
|
24
|
-
password: 'p@assedWard!'
|
25
|
+
password: 'p@assedWard!',
|
26
|
+
include_distribution_groups: true
|
25
27
|
}
|
26
28
|
end
|
27
29
|
|
data/lib/cratus/group.rb
CHANGED
@@ -33,7 +33,11 @@ module Cratus
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# TODO: move the search filter to a configurable param
|
36
|
-
|
36
|
+
if Cratus.config.include_distribution_groups
|
37
|
+
raw_groups = @raw_ldap_data[memrof_attr]
|
38
|
+
else
|
39
|
+
raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
|
40
|
+
end
|
37
41
|
initial_groups = raw_groups.map do |raw_group|
|
38
42
|
Group.new(raw_group.match(/^#{Group.ldap_dn_attribute.to_s.upcase}=([^,]+),/)[1])
|
39
43
|
end
|
data/lib/cratus/user.rb
CHANGED
@@ -57,7 +57,11 @@ module Cratus
|
|
57
57
|
def member_of
|
58
58
|
memrof_attr = Cratus.config.user_memberof_attribute
|
59
59
|
# TODO: move the search filter to a configurable param
|
60
|
-
|
60
|
+
if Cratus.config.include_distribution_groups
|
61
|
+
raw_groups = @raw_ldap_data[memrof_attr]
|
62
|
+
else
|
63
|
+
raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
|
64
|
+
end
|
61
65
|
initial_groups = raw_groups.map do |raw_group|
|
62
66
|
Group.new(raw_group.match(/^#{Group.ldap_dn_attribute.to_s.upcase}=([^,]+),/)[1])
|
63
67
|
end
|
data/lib/cratus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cratus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|