]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add LDAP test using ldapi:// scheme
authorNick Porter <nick@portercomputing.co.uk>
Thu, 24 Aug 2023 13:22:19 +0000 (14:22 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 24 Aug 2023 13:22:19 +0000 (14:22 +0100)
src/tests/modules/ldap/auth_ldapi.attrs [new file with mode: 0644]
src/tests/modules/ldap/auth_ldapi.unlang [new file with mode: 0644]
src/tests/modules/ldap/module.conf

diff --git a/src/tests/modules/ldap/auth_ldapi.attrs b/src/tests/modules/ldap/auth_ldapi.attrs
new file mode 100644 (file)
index 0000000..d08077d
--- /dev/null
@@ -0,0 +1,12 @@
+#
+#  Input packet
+#
+Packet-Type = Access-Request
+User-Name = "john"
+User-Password = "password"
+NAS-IP-Address = 1.2.3.5
+
+#
+#  Expected answer
+#
+Packet-Type == Access-Accept
diff --git a/src/tests/modules/ldap/auth_ldapi.unlang b/src/tests/modules/ldap/auth_ldapi.unlang
new file mode 100644 (file)
index 0000000..918e2a1
--- /dev/null
@@ -0,0 +1,13 @@
+#
+#  Run the "ldap" module
+#
+ldapldapi
+
+if (!(&control.LDAP-UserDN == "uid=john,ou=people,dc=example,dc=com")) {
+        test_fail
+}
+
+# Attempt a bind authentication
+ldapldapi.authenticate
+
+test_pass
index 2764dbcbcaab34a39c7a381c212aa02c9981b9c0..06266454c895b72dbeaed183741b4fa7cd76547a 100644 (file)
@@ -746,3 +746,46 @@ ldap ldapsasl {
                retry_delay = 1
        }
 }
+
+#
+#  Fifth LDAP connection using UNIX socket
+#
+ldap ldapldapi {
+       server = "ldapi://%2Ftmp%2Fldap%2Fsocket"
+       base_dn = 'dc=example,dc=com'
+
+       sasl {
+               mech = "EXTERNAL"
+       }
+
+       user {
+               base_dn = "ou=people,${..base_dn}"
+               filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})"
+               sasl {
+                       mech = 'DIGEST-MD5'
+                       authname = &User-Name
+               }
+       }
+
+       options {
+               chase_referrals = yes
+               rebind = yes
+               referral_depth = 2
+               timeout = 10
+               timelimit = 3
+               idle = 60
+               probes = 3
+               interval = 3
+       }
+
+       pool {
+               start = 0
+               min = 1
+               max = 4
+               spare = 3
+               uses = 0
+               lifetime = 0
+               idle_timeout = 60
+               retry_delay = 1
+       }
+}