Admin API (v0.3) #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Minimal operator surface for v0.3. Admin identity is a username allow-list (
auth.adminsin config), so it works identically across local / OIDC / LDAP — usernames match the authenticatedUser.Username.Endpoints (registered only when
auth.adminsis non-empty; each gated to admins, else 403):GET /api/v1/admin/info— server summary: version, storage driver, auth mode, shares/app-passwords enabled, quota (ifUsager), share count.GET /api/v1/admin/shares— list all share links (any creator). Reusesshare.Store.List(ctx, "").DELETE /api/v1/admin/shares/{token}— revoke any share link (closes the "admin action" gap flagged inshares.go's creator-only revoke).Also adds a small exported
auth.ContextWithUser(for tests + callers that establish identity outside the middleware).Deliberately excludes fine-grained per-file ACLs (ARCHITECTURE.md §5.4 keeps those out of the MVP). Additive and backward-compatible: with no
auth.adminsconfigured, nothing changes.Tests: admin gate (unauthenticated 403 / non-admin 403 / admin 200 + info body), list-all-shares across creators, revoke-any-share.