fix: expose files public links through portal

This commit is contained in:
Grendgi
2026-06-16 12:45:53 +03:00
parent cf92fda20e
commit ed49eab7b9
2 changed files with 5 additions and 4 deletions

View File

@@ -22,8 +22,10 @@
- `GET /api/nodes/{id}/access` - `GET /api/nodes/{id}/access`
- `PUT /api/nodes/{id}/access` - `PUT /api/nodes/{id}/access`
- `POST /api/nodes/{id}/public-links` - `POST /api/nodes/{id}/public-links`
- `GET /public/{token}` - `GET /public/{token}` внутри сервиса
- `GET /public/{token}/download` - `GET /public/{token}/download` внутри сервиса
- `GET /api/files/public/{token}` через Portal proxy
- `GET /api/files/public/{token}/download` через Portal proxy
## Миграционный путь ## Миграционный путь
@@ -31,4 +33,3 @@
2. Сделать новый UI `Файлы`: `Мои файлы` и `Доступные мне`. 2. Сделать новый UI `Файлы`: `Мои файлы` и `Доступные мне`.
3. Перенести старые `office_documents` и `google_sheets` в `files_nodes`. 3. Перенести старые `office_documents` и `google_sheets` в `files_nodes`.
4. После проверки выключить старые `/api/office` и `/api/sheets`. 4. После проверки выключить старые `/api/office` и `/api/sheets`.

View File

@@ -237,7 +237,7 @@ func (h *NodeHandler) CreatePublicLink(w http.ResponseWriter, r *http.Request) {
h.repo.Audit(r.Context(), userID, "files.public_link_create", "files_node", id, "{}") h.repo.Audit(r.Context(), userID, "files.public_link_create", "files_node", id, "{}")
writeJSON(w, http.StatusCreated, model.PublicLinkResponse{ writeJSON(w, http.StatusCreated, model.PublicLinkResponse{
ID: linkID, ID: linkID,
URL: strings.TrimRight(h.cfg.PublicBaseURL, "/") + "/public/files/" + token, URL: strings.TrimRight(h.cfg.PublicBaseURL, "/") + "/api/files/public/" + token,
ExpiresAt: req.ExpiresAt, ExpiresAt: req.ExpiresAt,
}) })
} }