fix: expose files public links through portal
This commit is contained in:
@@ -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`.
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user