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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 221de27655a5941283238844606c8d82cfd00bb9
4
- data.tar.gz: 41bd62644fe03681001864484cf0bf7821c2732a
3
+ metadata.gz: 3d6cd2098f290cd437c360a020a63076bdb4f4ab
4
+ data.tar.gz: 3f6f590b882dde7cc1b697ec2f9ae0458c5de912
5
5
  SHA512:
6
- metadata.gz: b5592e891bb9425e2cb6ea676718634c7f480fcd13374eb2fc22bf0b9c977f3db835fea028858a26e70ca5d59902e2126e43943126ac386dbb7304e352b2cbf0
7
- data.tar.gz: ab9cc09b7acee6afed3d2a2df01c40f9edb5ad6e8b53b501137745d1694581e77cd72256d47b4e92d9f62dd1e8fe350f1267e3723f816552d7e534359017825f
6
+ metadata.gz: 3650be4d866124d7016f1030a49b6314b57b339de99cfc16ab93c9af50162b4ee05ba564b7c9c2a05a3db0763ae51d61df2d126e307d5328786e88c1e9ee76e7
7
+ data.tar.gz: 3416b42866c6455682b1e31a9cc7d310bd2ee5734346425c68e61d9950794eb55adf97a487d05a4714cd7678495499addd4d0a29ef3051bfe3dd1dbc6a21bc1e
@@ -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
 
@@ -33,7 +33,11 @@ module Cratus
33
33
  end
34
34
 
35
35
  # TODO: move the search filter to a configurable param
36
- raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
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
@@ -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
- raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
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
@@ -2,7 +2,7 @@
2
2
  module Cratus
3
3
  def self.version
4
4
  major = 0 # Breaking, incompatible releases
5
- minor = 2 # Compatible, but new features
5
+ minor = 3 # Compatible, but new features
6
6
  patch = 7 # Fixes to existing features
7
7
  [major, minor, patch].map(&:to_s).join('.')
8
8
  end
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.2.7
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-09 00:00:00.000000000 Z
12
+ date: 2016-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize