Skip to content

[1.0.0] Add an extensible storage backend system for the LDAP server.#96

Merged
ChadSikorra merged 35 commits intoFreeDSx:1.0from
ChadSikorra:v1-storage-backend
Apr 11, 2026
Merged

[1.0.0] Add an extensible storage backend system for the LDAP server.#96
ChadSikorra merged 35 commits intoFreeDSx:1.0from
ChadSikorra:v1-storage-backend

Conversation

@ChadSikorra
Copy link
Copy Markdown
Contributor

@ChadSikorra ChadSikorra commented Mar 29, 2026

First pass at an extensible storage backend system for the LDAP server. Supports simple file based / in-memory by default. Adds a Swoole based server as an optional dependency, so pcntl isn't the only way to run it. It's also needed to support an in-memory approach. Though the file approach should work for either.

I have purposefully avoided some kind of MySQL / other explicitly DB backed solution for now. I will create some docs with some major caveats. This should really only be used for development purposes. The server component was not meant for high load or anything substantial. It's quite limited in its LDAP capabilities, though it does support quite a lot now.

I also need to go through this quite a bit before it's ready.

Edit: This turned into a beast. I really had to refactor and refine a ton of things to get a pluggable backend working. So this is almost a complete reworking of the old way you'd extend the backend server component. But it's way more customizable now and things are split apart in a more sane way:

  • Authentication is decoupled (and customizable -- noted in config).
  • Bind name resolution is decoupled (and customizable -- noted in config).
  • Storage adapter implementation is decoupled (file / json and in-memory support, but can implement your own).
  • Backend interface system only needs to implement a few core methods now.
  • Paging happens by default without needing to implement anything special.
  • Added a SwooleServer based server runner in addition to the PCNTL based one.

@ChadSikorra ChadSikorra force-pushed the v1-storage-backend branch 9 times, most recently from 6e436f5 to b5d9773 Compare April 5, 2026 21:08
@ChadSikorra ChadSikorra force-pushed the v1-storage-backend branch 2 times, most recently from a678007 to 615c047 Compare April 5, 2026 21:53
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 74.77341% with 334 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.29%. Comparing base (668f8c2) to head (8566768).

Files with missing lines Patch % Lines
...Sx/Ldap/Server/ServerRunner/SwooleServerRunner.php 0.00% 81 Missing ⚠️
...ap/Server/ServerRunner/ServerRunnerLoggerTrait.php 0.00% 73 Missing ⚠️
...DSx/Ldap/Server/ServerRunner/PcntlServerRunner.php 0.00% 34 Missing ⚠️
...ver/Backend/Storage/Adapter/Lock/CoroutineLock.php 0.00% 29 Missing ⚠️
...Server/Backend/Storage/Adapter/JsonFileStorage.php 81.90% 19 Missing ⚠️
.../Server/Backend/Storage/WritableStorageBackend.php 89.21% 11 Missing ⚠️
...reeDSx/Ldap/Server/RequestHandler/ProxyBackend.php 83.33% 10 Missing ⚠️
src/FreeDSx/Ldap/Server/Backend/GenericBackend.php 0.00% 9 Missing ⚠️
...p/Server/Backend/Storage/Adapter/Lock/FileLock.php 76.31% 9 Missing ⚠️
...ocol/ServerProtocolHandler/ServerPagingHandler.php 92.15% 8 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff              @@
##                1.0      #96      +/-   ##
============================================
- Coverage     88.12%   86.29%   -1.83%     
- Complexity     2290     2600     +310     
============================================
  Files           174      196      +22     
  Lines          7225     8173     +948     
============================================
+ Hits           6367     7053     +686     
- Misses          858     1120     +262     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChadSikorra ChadSikorra force-pushed the v1-storage-backend branch 3 times, most recently from e1d9a2a to 3c513e5 Compare April 5, 2026 22:24
Fix tests. Fix where coroutine hooks are enabled.
@ChadSikorra ChadSikorra merged commit 1a13560 into FreeDSx:1.0 Apr 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant