Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock returns data that it should not when searching by dn #27

Open
SirLefti opened this issue Mar 1, 2024 · 0 comments
Open

Mock returns data that it should not when searching by dn #27

SirLefti opened this issue Mar 1, 2024 · 0 comments

Comments

@SirLefti
Copy link

SirLefti commented Mar 1, 2024

I start the mock with the command line:

npx ldap-server-mock --conf=ldap-server-config.json --database=ldap-server-data.json

ldap-server-config.json:

{
    "port": 389,
    "searchBase": "dc=test"
}

ldap-server-data.json (just added another user):

[
    {
        "dn": "cn=user,dc=test",
        "attributes": {
            "objectClass": "person",
            "cn": "user-login",
            "attribute1": "value1",
            "attribute2": "value2"
        }
    },
    {
        "dn": "cn=user2,dc=test",
        "attributes": {
            "objectClass": "person",
            "cn": "user2-login",
            "attribute1": "value1",
            "attribute2": "value2"
        }
    }
]

When requesting the first user by its dn, I am getting both users instead:

ldapsearch -x -H ldap://127.0.0.1:389 -b "cn=user,dc=test"

# user, test
dn: cn=user,dc=test
objectClass: person
cn: user-login
attribute1: value1
attribute2: value2

# user2, test
dn: cn=user2,dc=test
objectClass: person
cn: user2-login
attribute1: value1
attribute2: value2

I can get the entry I want by using a filter instead, however the mock should not return entries that are not in the scope.
Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant