F2 of the go-live plan ("Unterlagen"), registry side. **Stacked on #33**: merge #33 first.
| Route | Group | What |
|---|---|---|
| `POST /v1/admin/tenants/{id}/documents` | admin | multipart upload (title, description, file) → draft; streamed to S3 with SHA-256; limit `DOCUMENTS_MAX_MB` (200); allowed pdf/zip/docx/xlsx/pptx/png/jpg/txt/csv/json/xml |
| `GET /v1/admin/tenants/{id}/documents` | admin | all, drafts included |
| `POST /v1/admin/documents/{doc}/publish` | admin | visible to the tenant (idempotent); the F3 mail hook goes here |
| `DELETE /v1/admin/documents/{doc}` | admin | file + row |
| `GET /v1/tenants/{id}/documents` | tenants.read | published only (via the `{id}/{sub}` route, like members) |
| `GET /v1/tenants/{id}/documents/{doc}/download` | tenants.read | 5-minute presigned URL; audit `document.downloaded` (user, or `X-Portal-User-Email` from the portal) |
- Migration **0008_documents**; store in memory and Postgres.
- `internal/storage`: minio-go against Hetzner (creates the bucket in `DOCUMENTS_S3_REGION` when missing) plus an in-memory fake.
- Config: `DOCUMENTS_S3_ENDPOINT`, `_REGION` (nbg1), `_BUCKET`, `_ACCESS_KEY`, `_SECRET_KEY`, `DOCUMENTS_MAX_MB`. Unset → 503 on these routes only.
- Object keys never leave the registry (`json:"-"`). File names are sanitised. `Content-Disposition` carries the UTF-8 name (RFC 5987).
Tests: both stores (upload → draft hidden → publish → download → cross-tenant 404 → delete), type, size and storage failures, the unconfigured case; OpenAPI documented.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
A new route group "admin" (the portal's service client only) serves
the staff admin area: tenant search with 30-day usage and last
activity, one detail call with entitlements, subscriptions, licences,
members and recent audit, trial extension (moves trial entitlements
with it and reopens a trial that expired into read-only), invite
resend, and the audit log across tenants.
Changes made from the admin area are audited under the staff member
the portal names in X-Staff-Subject / X-Staff-Email; the header only
counts from a client that holds the admin group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Staff upload a file for a tenant as a draft (streamed to an S3 bucket,
hashed on the way, never buffered whole), publish it, or delete it;
the tenant lists its published documents and gets a five-minute
presigned download link. Uploads, publications and downloads are
audited, a download under the person the portal names.
Migration 0008 adds the documents table; internal/storage wraps
minio-go (Hetzner Object Storage, the bucket is created in its
region when missing). Without DOCUMENTS_S3_* the routes answer 503
and the rest of the registry is unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
F2 of the go-live plan ("Unterlagen"), registry side. Stacked on #33: merge #33 first.
POST /v1/admin/tenants/{id}/documentsDOCUMENTS_MAX_MB(200); allowed pdf/zip/docx/xlsx/pptx/png/jpg/txt/csv/json/xmlGET /v1/admin/tenants/{id}/documentsPOST /v1/admin/documents/{doc}/publishDELETE /v1/admin/documents/{doc}GET /v1/tenants/{id}/documents{id}/{sub}route, like members)GET /v1/tenants/{id}/documents/{doc}/downloaddocument.downloaded(user, orX-Portal-User-Emailfrom the portal)internal/storage: minio-go against Hetzner (creates the bucket inDOCUMENTS_S3_REGIONwhen missing) plus an in-memory fake.DOCUMENTS_S3_ENDPOINT,_REGION(nbg1),_BUCKET,_ACCESS_KEY,_SECRET_KEY,DOCUMENTS_MAX_MB. Unset → 503 on these routes only.json:"-"). File names are sanitised.Content-Dispositioncarries the UTF-8 name (RFC 5987).Tests: both stores (upload → draft hidden → publish → download → cross-tenant 404 → delete), type, size and storage failures, the unconfigured case; OpenAPI documented.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB