Fixes #3373 - LDAP users marked as inactive.

This commit is contained in:
Thorsten Eckel 2021-01-18 16:30:49 +01:00
parent 6c3d8b8b36
commit c6fb3370e2
2 changed files with 7 additions and 5 deletions

View file

@ -18,7 +18,7 @@ class Sequencer
provides :action provides :action
def process def process
return if !skip? return if !mandatory_missing?
logger.info { skip_log_message } logger.info { skip_log_message }
state.provide(:action, :skipped) state.provide(:action, :skipped)
@ -30,10 +30,10 @@ class Sequencer
raise "Missing implementation of '#{__method__}' method for '#{self.class.name}'" raise "Missing implementation of '#{__method__}' method for '#{self.class.name}'"
end end
def skip? def mandatory_missing?
return true if attribute_value.blank? return true if attribute_value.blank?
missing_for_keys.blank? missing_for_keys.present?
end end
def skip_log_message def skip_log_message

View file

@ -23,6 +23,7 @@ RSpec.describe ::Sequencer::Sequence::Import::Ldap::Users, sequencer: :sequence
group_entry.dn => [1, 2] group_entry.dn => [1, 2]
}, },
user_attributes: { user_attributes: {
'samaccountname' => 'login',
'first_name' => 'firstname', 'first_name' => 'firstname',
}, },
user_uid: 'objectguid', user_uid: 'objectguid',
@ -107,6 +108,7 @@ RSpec.describe ::Sequencer::Sequence::Import::Ldap::Users, sequencer: :sequence
group_entry.dn => agent_admin_role_ids group_entry.dn => agent_admin_role_ids
}, },
user_attributes: { user_attributes: {
'samaccountname' => 'login',
'first_name' => 'firstname', 'first_name' => 'firstname',
}, },
user_uid: 'objectguid', user_uid: 'objectguid',