ldap_source.rb 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :ldap_source do
  4. sequence(:name) { |n| "Source #{n}" }
  5. active { true }
  6. created_by_id { 1 }
  7. updated_by_id { 1 }
  8. trait :with_config do
  9. preferences do
  10. {
  11. 'host_url' => ENV['IMPORT_LDAP_ENDPOINT'],
  12. 'options' => { 'dc=foo,dc=example,dc=com'=>'dc=foo,dc=example,dc=com' },
  13. 'option' => 'dc=foo,dc=example,dc=com',
  14. 'base_dn' => 'dc=foo,dc=example,dc=com',
  15. 'bind_user' => ENV['IMPORT_LDAP_USER'],
  16. 'bind_pw' => ENV['IMPORT_LDAP_PASSWORD'],
  17. 'user_uid' => 'uid',
  18. 'user_filter' => '(objectClass=posixaccount)',
  19. 'group_uid' => 'dn',
  20. 'group_filter' => '(objectClass=posixgroup)',
  21. 'user_attributes' => { 'cn' => 'firstname', 'sn' => 'lastname', 'mail' => 'email', 'uid' => 'login', 'telephonenumber' => 'phone' },
  22. 'group_role_map' =>
  23. { 'cn=admin,ou=groups,dc=foo,dc=example,dc=com' => ['1'], 'cn=1st level,ou=groups,dc=foo,dc=example,dc=com' => ['2'] },
  24. 'unassigned_users' => 'sigup_roles'
  25. }
  26. end
  27. end
  28. end
  29. end