feat(ldap): endpoint walk with sticky-preference failover in LdapAuthService

This commit is contained in:
Joseph Doherty
2026-08-10 16:37:14 -04:00
parent 0a8fe68d0a
commit 174ad952dc
3 changed files with 385 additions and 20 deletions
@@ -94,6 +94,13 @@ Inside `LdapAuthService.Authenticate`, an endpoint walk over an internal
preferred fails; when it does, the walk tries declared order again, so
preference drifts back to the primary naturally.
> **Refinement (Task 4):** sticky preference updates on ANY authoritative answer
> (success or user-side failure), not only on success — a DC that answers is healthy,
> and success-only stickiness would re-pay the dead primary's connect timeout on every
> mistyped password during an outage. Corollary, also implemented: an *exhausted* walk
> (every endpoint system-side-down) leaves the preference untouched, since a total
> outage says nothing about which endpoint to prefer once one recovers.
## Stickiness state
`volatile int _preferredIndex` on the singleton `LdapAuthService` (registered