synology-api icon indicating copy to clipboard operation
synology-api copied to clipboard

WIP: Add LDAP Server API

Open n1cc00 opened this issue 3 months ago • 1 comments

WIP: LDAP Server API

This PR introduces initial support for the Synology LDAP Server API.

Context

The naming for the Directory / LDAP Server APIs is very confusing:

  • LDAP Server endpoints are accessed via the SYNO.DirectoryServer API.
  • Directory Server endpoints, however, use the SYNO.ActiveDirectory API.

What’s Included

  • New endpoints:
    • list_users
    • create_new_user

Missing

Of course, there are other endpoints to be implemented. Also, proper error handling needs to be added. I wasn't sure how to correctly match SYNO.Entry.Request, because besides Syno.ActiveDirectory (the Directory Server API), Syno.DirectoryServer (the LDAP Server API) seems to use it too. So I left that for later.

Extended parameter validation should also be added as the LDAP API seems to sometimes add invalid/incomplete entries instead of rejecting them (moving the example _assert_expireddate_validity() function to another place in the codebase along with other functions)

I hope to be able add more myself in the near future but as my time is very limited right now, I wanted to publish this draft first.

This is NOT really tested yet. Will do that in the next days.

n1cc00 avatar Sep 30 '25 10:09 n1cc00