Skip to content

feat(s3): add short access links and SDK core#7281

Open
xqvvu wants to merge 11 commits into
labring:mainfrom
xqvvu:xqvvu/s3-shortlink-sdk-wrapper
Open

feat(s3): add short access links and SDK core#7281
xqvvu wants to merge 11 commits into
labring:mainfrom
xqvvu:xqvvu/s3-shortlink-sdk-wrapper

Conversation

@xqvvu

@xqvvu xqvvu commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add short S3 download alias URLs (/api/system/file/d/<alias>.<exp>.<sig>) and short upload session URLs (/api/system/file/u/<token>).
  • Extract the access-link protocol into @fastgpt-sdk/storage/access-link so other trusted services can reuse HMAC signing, TTL bucketing, alias reuse, upload token hashing, verification, and revoke logic.
  • Keep FastGPT runtime concerns in service adapters: Mongo stores, route builders, proxy handlers, and error mapping.
  • Preserve legacy JWT download/upload route compatibility for already-issued links while new signing paths issue short access links.
  • Update dataset/search/quote preview URL generation to use async shortlink signing from the previous shortlink implementation.

Tests

  • pnpm exec vitest run -c vitest.config.mts test/sdk/storage/accessLink.test.ts
  • pnpm --filter @fastgpt-sdk/storage build
  • pnpm --filter @fastgpt/app typecheck
  • 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
  • git diff --check

Notes

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 18.43% 1632 / 8855
🔵 Statements 18.41% 1713 / 9300
🔵 Functions 16.21% 342 / 2109
🔵 Branches 15.1% 759 / 5024
File CoverageNo changed files found.
Generated in workflow #1398 for commit d2007fa by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_d2007fa89556ce70469518b8ab6e93fadd58589e

🕒 Time: 2026-07-14 16:24:12 (UTC+8)

@xqvvu xqvvu force-pushed the xqvvu/s3-shortlink-sdk-wrapper branch from 5bfe7be to 1518715 Compare July 8, 2026 06:37
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_d2007fa89556ce70469518b8ab6e93fadd58589e

🕒 Time: 2026-07-14 16:27:31 (UTC+8)

@xqvvu xqvvu force-pushed the xqvvu/s3-shortlink-sdk-wrapper branch 3 times, most recently from a30862c to cc3a128 Compare July 14, 2026 07:31
@xqvvu xqvvu force-pushed the xqvvu/s3-shortlink-sdk-wrapper branch from cc3a128 to d2007fa Compare July 14, 2026 08:15
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