mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Their exports name attachments without carrying the files, so the files were reported as a loss. Each service documents where a file is downloaded, behind the same sign-in as its API: - Jira: fields.attachment[].content (/rest/api/3/attachment/content/<id>), Basic email:API token; Jira's redirect to its media store is followed without the sign-in. - Deck: /index.php/apps/deck/api/v1.0|v1.1/boards/../stacks/../cards/.. /attachments/<id>, Basic user:app password, OCS-APIRequest: true. - OpenProject: _links.downloadLocation, relative to the instance, Basic apikey:<key>. - Asana: GET /attachments/<gid>?opt_fields=download_url with a personal access token, then the signed download_url without it; a file the export embeds (export_boards.pl) is taken as it is; one kept on Google Drive and the like is a link, reported. - GitLab: a private project's /uploads/ link through /api/v4/projects/<id>/uploads/<secret>/<file> (17.4+), Bearer token. The import page asks for the address, user and token under "Attachment files" for these five (the REST import takes the same as attachmentAuth). They go with that one import: held beside the creator in a WeakMap, never stored or logged, the token field emptied on Import, and sent ONLY to the origin the member typed - an export names any URL it likes. Every download is the import's SSRF-guarded fetch, which validates each hop and drops Authorization on a cross-origin redirect. A file that cannot be fetched is on the loss report with its reason. Unticking Attachments leaves them out (Jira's per-issue field is pruned too). Zenkit is left out: it publishes no way to download a file. Tests: importAttachmentAuth.test.cjs (each service's request, the sign-in only to its origin, malformed sign-ins, never stored or logged), the parser tests pin the attachment lists, a Meteor test imports an embedded Asana file onto its card and shows a Jira file is reported without a sign-in and that the sign-in never reaches an address the guard refuses, and import-attachment-auth.e2e.js the page (not run here). Not run against the live services. Thanks to xet7 !