Release 1.11.0: end-user catalog, access requests, nested groups

Closes the end-user half of the directory and adds nested LDAP groups.

The directory could describe the lab but could not tell anyone what they had
or how to reach it, and several of the paths meant to do so were silently
returning nothing:

  - GET /api/discovery/me resolved groups from req.user.groups, which does not
    exist (req.user carries memberOf), so it returned only isPublic resources
    for every human caller -- "My Services" was blank for everyone. The same
    read made isDirectoryAdmin() false for real admins.
  - The portal's "Discover More Services" called the admin-gated endpoint and
    swallowed the 403, so it never rendered for non-admins at all.
  - Services reported no address, because /me had reimplemented getMyAccess
    without its parent-walking resolution.

Adds the catalog at /, self-service access requests, and admin access
visibility (per-resource counts, and the reverse "what can this user reach").

Nested groups come in two halves. groupOfNames.member already accepts a group
DN, so nesting needs no schema -- what it needs is resolution, which no
released OpenLDAP performs. The all-in-one image therefore builds slapd from a
pinned master commit for the nestgroup overlay, and the app computes the
closure itself when pointed at a server without it. Both paths are covered.

member-values is deliberately left out of nestgroup-flags: it expands `member`
when reading a group, which destroys the distinction between "listed here" and
"reachable through a nested group" and is not recoverable afterwards.

Full suite green in both resolution modes: 215 passed, 2 skipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 01:22:08 -04:00
parent aa2592ea4e
commit 4a592f9795
33 changed files with 2314 additions and 246 deletions
+64
View File
@@ -703,6 +703,10 @@ The authenticated user is automatically set as the group owner.
{ "results": true, "message": "Added user uid to group group." }
```
Returns `409` if the user is already a member — common in practice, since
`groupOfNames` requires at least one member and so seeds whoever created the
group into it.
---
### Remove User from Group
@@ -716,6 +720,66 @@ The authenticated user is automatically set as the group owner.
---
### Nest a Group Inside Another
**`PUT /api/group/:group/nested/:child`** — `app_sso_admin` or group owner
Makes `:child` a member of `:group`, so everyone in `:child` is a member of
`:group` at any depth.
**Response:**
```json
{ "results": { "cn": "group", "member": ["..."] }, "message": "Nested child inside group." }
```
**Errors:**
| Status | When |
|--------|------|
| `400` | `:group` and `:child` are the same group |
| `409` | already nested, or the nesting would create a loop (`:child` already contains `:group`, directly or transitively) |
---
### Un-nest a Group
**`DELETE /api/group/:group/nested/:child`** — `app_sso_admin` or group owner
**Response:**
```json
{ "results": { "cn": "group", "member": ["..."] }, "message": "Removed child from group." }
```
**Errors:**
| Status | When |
|--------|------|
| `409` | `:child` is the only member — `groupOfNames` requires at least one |
---
### Effective Membership
**`GET /api/group/:group/effective`** — Any authenticated user
Who a group actually grants. `direct` is users listed on the group itself
(never groups); `nestedGroups` is what is nested into it; `effective` is every
user reachable through the whole chain.
**Response:**
```json
{
"results": {
"cn": "app_gitea_access",
"direct": ["cn=alice,ou=people,dc=example,dc=com"],
"nestedGroups": [{ "cn": "developers", "dn": "cn=developers,ou=groups,dc=example,dc=com" }],
"effective": ["cn=alice,ou=people,dc=example,dc=com", "cn=bob,ou=people,dc=example,dc=com"]
}
}
```
---
### Delete Group
**`DELETE /api/group/:group`** — `app_sso_admin` or group owner