From 13b763bfad18134677c3f285c3f32a4e7867abcf Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 9 Jan 2018 11:50:52 +0100 Subject: [PATCH 1/3] Fixed wrong file location. --- .../unit/import/common/model/reset_primary_key_sequence_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{ => lib}/sequencer/unit/import/common/model/reset_primary_key_sequence_spec.rb (100%) diff --git a/spec/sequencer/unit/import/common/model/reset_primary_key_sequence_spec.rb b/spec/lib/sequencer/unit/import/common/model/reset_primary_key_sequence_spec.rb similarity index 100% rename from spec/sequencer/unit/import/common/model/reset_primary_key_sequence_spec.rb rename to spec/lib/sequencer/unit/import/common/model/reset_primary_key_sequence_spec.rb From 66988facc1271fd18f86b4d4d903e38fccf6b32d Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 9 Jan 2018 12:20:04 +0100 Subject: [PATCH 2/3] Ensures resolved issue #1665 - Added RSpec test to ensure LDAP attributes get reset if no value is provided from remote. --- .../unit/import/ldap/user/mapping_spec.rb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/lib/sequencer/unit/import/ldap/user/mapping_spec.rb diff --git a/spec/lib/sequencer/unit/import/ldap/user/mapping_spec.rb b/spec/lib/sequencer/unit/import/ldap/user/mapping_spec.rb new file mode 100644 index 000000000..8ec256d92 --- /dev/null +++ b/spec/lib/sequencer/unit/import/ldap/user/mapping_spec.rb @@ -0,0 +1,27 @@ +require 'rails_helper' + +RSpec.describe Sequencer::Unit::Import::Ldap::User::Mapping, sequencer: :unit do + + it 'ensures to unset attribute value if none is provided' do + + ldap_config = { + user_attributes: { + firstName: 'firstname', + lastName: 'lastname', + samaccountname: 'login', + } + } + + resource = { + samaccountname: 'Some41', + firstName: 'Some', + } + + provided = process( + ldap_config: ldap_config, + resource: resource, + ) + + expect(provided['lastname']).to be_nil + end +end From 8272ae2bb515f37db6ff84c1658a3fc45d3c5f96 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 9 Jan 2018 12:45:50 +0100 Subject: [PATCH 3/3] Fixes issue #1664 - Missing support for groupOfUniqueNames / uniquemember in LDAP sync. --- lib/ldap/group.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldap/group.rb b/lib/ldap/group.rb index a1c5419f4..e92aa58ad 100644 --- a/lib/ldap/group.rb +++ b/lib/ldap/group.rb @@ -112,7 +112,7 @@ class Ldap # # @return [String, nil] The active or found filter or nil if none could be found. def filter - @filter ||= lookup_filter(['(objectClass=group)', '(objectClass=posixgroup)', '(objectClass=organization)']) + @filter ||= lookup_filter(['(objectClass=groupOfUniqueNames)', '(objectClass=group)', '(objectClass=posixgroup)', '(objectClass=organization)']) end # The active uid attribute of the instance. If none give on initialization an automatic lookup is performed.