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
test(web): close review gaps in the password-expiry view
Addresses the confirmed findings of the adversarial review of #626.
Testability seams. RequireAdmin now resolves its admin check per request, and
the App carries two nil-defaulted overrides — adminCheck and expiryResolver —
so tests can drive the handler behind the gate. Without them the handler had
0% coverage: the only route test stopped at the 403, because a DN-addressable
admin cache entry cannot be built outside the LDAP package. New handler tests
cover the 503 no-service-account guard, the admit path, the days/show/sort
query-param wiring, and the resolver-error branch. handlePasswordExpiryV2 goes
from 0% to 94.7%, RequireAdmin to 100%.
Untested guards. Added the empty-admin-group case (a directory returning an
empty group entry must not match an unset admin group) and the status-sort
column, both previously surviving mutants.
Undated rows now sort to the bottom in BOTH directions. The old sentinel kept
must-change/never/unknown last only under ascending; under descending they
floated to the top above the furthest concrete deadline. sortByDeadline pins
them at the bottom regardless of direction, and the dead expiryOrder sentinel
is gone.
Accessibility. Sort headers now carry aria-sort (ascending/descending/none) so
the active column and direction reach assistive technology rather than living
only in an aria-hidden arrow — a fix in the shared tableSortHeader helper, so
every V2 table gains it. The deadline cell for undated rows pairs the visual
em-dash with an sr-only "No expiry date" instead of announcing a lone dash.
Documented that AD's adminCount is sticky, so admin access via that marker
outlives de-privilege; prefer LDAP_ADMIN_GROUP where access should track
current privilege.
Not changed: the client-side filter does not announce "no results" via a live
region — a pre-existing gap in the shared search JS affecting every V2 list
table, out of scope here.
Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ When no readonly user is configured, the app uses per-user LDAP credentials for
118
118
119
119
`/password-expiry` lists accounts whose LDAP password is expiring, resolved live via [simple-ldap-go](https://github.com/netresearch/simple-ldap-go)'s expiry API. It is **admin-only** and needs the service account.
120
120
121
-
An admin is a member of `LDAP_ADMIN_GROUP`**or** an account carrying Active Directory's `adminCount=1`. On OpenLDAP there is no `adminCount`, so `LDAP_ADMIN_GROUP` is the only way to grant access — without it, the roster is reachable by no one. Group membership is read from the user's `memberOf`, which Active Directory populates automatically; an OpenLDAP deployment must have the `memberof` overlay enabled for the group gate to work.
121
+
An admin is a member of `LDAP_ADMIN_GROUP`**or** an account carrying Active Directory's `adminCount=1`. Note that `adminCount` is *sticky*: Active Directory sets it when an account joins a protected group and never clears it on removal, so an account that was ever privileged keeps roster access. Prefer `LDAP_ADMIN_GROUP` membership where you want access to track current privilege. On OpenLDAP there is no `adminCount`, so `LDAP_ADMIN_GROUP` is the only way to grant access — without it, the roster is reachable by no one. Group membership is read from the user's `memberOf`, which Active Directory populates automatically; an OpenLDAP deployment must have the `memberof` overlay enabled for the group gate to work.
122
122
123
123
The default view shows accounts due within a window (`?days=`, default 30, capped at 366); a **Show all accounts** toggle adds the never-expires and unknown accounts with a status badge. On OpenLDAP, expiry needs the `ppolicy` overlay; accounts the directory reports nothing about show as `unknown`.
0 commit comments