You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/ldap/overview.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
title: LDAP Documentation
3
3
description: Integrate your App with a mock LDAP server
4
4
---
5
+
5
6
# Mocking LDAP server
6
7
7
8
Mokapi simplifies the process of creating a basic read-only LDAP server mock, enabling you to efficiently test and debug your LDAP interactions. Whether your goal is to validate query accuracy or simulate specific LDAP entry scenarios, Mokapi provides a flexible and developer-friendly solution.
@@ -27,32 +28,32 @@ Below is an example of the simplest configuration, which does not include any cu
27
28
This basic setup is ideal for testing and development purposes, where the focus is on simulating server behavior rather than interacting with actual LDAP entries. You can later extend this configuration by adding LDAP entries and more advanced server settings as needed.
28
29
29
30
```yaml tab=ldap.yaml
30
-
ldap: 1.0# file configuration version not LDAP protocol version
31
+
ldap: 1.0# file configuration version not LDAP protocol version
31
32
host: :389
32
33
```
33
34
34
35
To start Mokapi with a specific configuration file, you can use the --provider-file-filename option in the command line. This tells Mokapi to load the specified configuration file when it starts.
35
36
36
37
```bash
37
-
mokapi --provider-file-filename ldap.yaml
38
+
mokapi --providers-file-filename ldap.yaml
38
39
```
39
40
40
41
## Setup a Simple LDAP Entry Structure
41
42
42
-
Mokapi allows you to configure your LDAP mock server using LDIF files. It supports a wide range of LDIF operations,
43
-
such as adding new entries, modifying attributes, and even deleting attributes. This flexibility makes it
43
+
Mokapi allows you to configure your LDAP mock server using LDIF files. It supports a wide range of LDIF operations,
44
+
such as adding new entries, modifying attributes, and even deleting attributes. This flexibility makes it
44
45
easy to simulate real-world LDAP scenarios and test different interactions with your server.
45
46
46
-
In your configuration file, you can reference multiple LDIF files. Mokapi will continuously monitor these files and
47
-
automatically update the LDAP server whenever a change is detected. This dynamic reloading of LDIF files helps streamline
47
+
In your configuration file, you can reference multiple LDIF files. Mokapi will continuously monitor these files and
48
+
automatically update the LDAP server whenever a change is detected. This dynamic reloading of LDIF files helps streamline
48
49
the testing and development process, ensuring that your mock server always reflects the latest configurations.
49
50
50
51
In the following example, we define an LDAP entry `dc=example,dc=com` and assign it the `top` object class.
51
52
This entry is added to the `namingContexts` in the Root DSE. Additionally, we include a user entry for `cn=alice,dc=example,dc=com?`.
52
53
This LDIF file can be referenced in the LDAP configuration file using a relative path.
53
54
54
-
```box=tip
55
-
You can also reference an LDIF file using an HTTP or GIT URL, allowing you to source configuration data from remote
55
+
```box=tip
56
+
You can also reference an LDIF file using an HTTP or GIT URL, allowing you to source configuration data from remote
56
57
locations or version-controlled repositories for better integration and versioning.
57
58
```
58
59
@@ -72,7 +73,7 @@ cn: alice
72
73
In the LDAP configuration, you would reference this LDIF file as follows:
73
74
74
75
```yaml tab=ldap.yaml
75
-
ldap: 1.0# file configuration version not LDAP protocol version
76
+
ldap: 1.0# file configuration version not LDAP protocol version
76
77
host: :389
77
78
files:
78
79
- ./example.ldif
@@ -83,7 +84,7 @@ This setup provides a foundational LDAP structure, which you can build upon by a
83
84
To query the example LDAP setup, you can use the ldapsearch command, which is a common tool for querying LDAP directories from the command line.
0 commit comments