Skip to content

feat(s3): add short access links#7262

Open
xqvvu wants to merge 1 commit into
labring:mainfrom
xqvvu:xqvvu/s3-shortlink-access-token
Open

feat(s3): add short access links#7262
xqvvu wants to merge 1 commit into
labring:mainfrom
xqvvu:xqvvu/s3-shortlink-access-token

Conversation

@xqvvu

@xqvvu xqvvu commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add short S3 download alias URLs (/api/system/file/d/<alias>.<exp>.<sig>) backed by stable Mongo alias documents.
  • Add short upload session URLs (/api/system/file/u/<token>) backed by hashed Mongo session records.
  • Reuse shared S3 proxy handlers for new short routes and legacy JWT compatibility routes.
  • Update dataset/search/quote preview URL generation to use async shortlink signing.
  • Add PR1 design notes and focused shortlink/proxy compatibility tests.

Tests

  • git diff --check
  • From packages/service: pnpm exec vitest run -c vitest.config.ts test/common/s3/accessLink.test.ts test/common/s3/token.test.ts test/core/dataset/utils.test.ts test/core/dataset/data/controller.test.ts
  • From projects/app: pnpm exec vitest run -c vitest.config.ts test/api/system/file/accessLink.test.ts test/api/system/file/sourceContentType.test.ts

Notes

  • Legacy JWT download/upload routes are kept for already-issued links, but new proxy signing paths now issue short access links.
  • PR2 upload policy validation and PR3 ChatBox upload abort remain out of scope for this PR.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 16.43% 1354 / 8239
🔵 Statements 16.36% 1414 / 8642
🔵 Functions 14.45% 288 / 1993
🔵 Branches 13.31% 618 / 4642
File CoverageNo changed files found.
Generated in workflow #1267 for commit 1351e50 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_1351e5093380a5a7b3e918267751a9dea68d407f

🕒 Time: 2026-07-06 16:38:47 (UTC+8)

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_1351e5093380a5a7b3e918267751a9dea68d407f

🕒 Time: 2026-07-06 16:39:33 (UTC+8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant