Skip to content

Sync/upstream merge - #3030

Closed
zymooll wants to merge 15 commits into
OpenListTeam:mainfrom
zymooll:sync/upstream-merge
Closed

Sync/upstream merge#3030
zymooll wants to merge 15 commits into
OpenListTeam:mainfrom
zymooll:sync/upstream-merge

Conversation

@zymooll

@zymooll zymooll commented Sep 3, 2026

Copy link
Copy Markdown

No description provided.

zymooll and others added 15 commits June 27, 2026 06:27
- add a native PDS driver with list, link, upload, mkdir, rename, move, copy, recycle-bin delete, and storage details support

- persist refreshed OAuth tokens and allow either access_token or refresh_token for authentication

- register the driver and cover initialization/query escaping behavior with focused tests
feat(driver): add PDS storage driver
- Move PDS helper functions out of driver.go into util.go.

- Remove the PDS driver test file from the tracked tree while keeping local tests available.
Copilot AI lite review requested due to automatic review settings September 3, 2026 09:22
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ PR 标题需以 feat(): , docs(): , fix(): , style(): , refactor(): , chore(): 其中之一开头,例如:feat(component): 新增功能
⚠️ The PR title must start with feat(): , docs(): , fix(): , style(): , or refactor(): , chore(): . For example: feat(component): add new feature.

如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。
If it spans multiple components, use the main component as the prefix and enumerate in the title, describe in the body.

如果是破坏性变更,请在类型后添加 !,例如 feat(component)!: 破坏性变更
For breaking changes, add ! after the type, e.g., feat(component)!: breaking change.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

PDS direct-upload completion currently doesn’t bind the request file_name to the signed token, weakening the handler’s permission/mount-path checks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a “complete direct upload” API and plumbing to finalize client-side direct uploads, and introduces a new PDS storage driver that supports direct upload sessions (issue token → client uploads bytes → server commits session).

Changes:

  • Added /api/fs/complete_direct_upload endpoint to commit a previously initiated direct-upload session.
  • Added DirectUploadCompleter driver interface plus fs/op plumbing to execute completion and trigger object-update hooks.
  • Added new drivers/pds implementation, including direct upload token signing and completion logic, and registered it in drivers/all.go.
File summaries
File Description
server/router.go Registers the new direct-upload completion route under the fs API group.
server/handles/direct_upload.go Implements FsCompleteDirectUpload handler with path resolution and permission checks.
internal/op/fs.go Adds op.CompleteDirectUpload for driver-level completion + hook trigger.
internal/fs/put.go Adds internal completeDirectUpload helper to resolve storage and call op layer.
internal/fs/fs.go Exposes fs.CompleteDirectUpload wrapper with logging.
internal/driver/driver.go Introduces DirectUploadCompleter interface for drivers that can commit direct uploads.
drivers/all.go Registers the new PDS driver.
drivers/pds/api.go Adds PDS API client, token refresh handling, and request helpers.
drivers/pds/driver.go Implements core PDS driver operations (Init/List/Get/Link/CRUD-like ops).
drivers/pds/meta.go Defines PDS driver config/addition fields and registers the driver.
drivers/pds/types.go Defines PDS response types and conversion to model.Obj.
drivers/pds/upload.go Implements PDS direct upload initiation + completion and token signing/verification.
drivers/pds/util.go Adds helpers for PDS path/object lookups and query escaping.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread drivers/pds/upload.go
Comment on lines +165 to +169
if token.DomainID != d.DomainID || token.DriveID != d.DriveID ||
token.ParentFileID != d.fileID(dstDir) {
return nil, fmt.Errorf("direct upload token does not match request")
}
if token.FileID == "" || token.UploadID == "" {
Comment thread drivers/pds/upload.go
Comment on lines +205 to +209
func (d *PDS) verifyDirectUploadToken(raw string) (*directUploadToken, error) {
payloadText, signature, ok := strings.Cut(raw, ".")
if !ok || payloadText == "" || signature == "" {
return nil, fmt.Errorf("invalid direct upload token")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants