Skip to content

Conversation

@zzzhr1990
Copy link
Contributor

@zzzhr1990 zzzhr1990 commented Oct 5, 2025

Description / 描述

  • 新增清真云的Open驱动,支持用户级ClientID/ClientSecret,无需登录
  • 支持文件直链下载(302)
  • 支持新的文件上传

Motivation and Context / 背景

支持文件上传

Closes #1255

How Has This Been Tested? / 测试

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@zzzhr1990 zzzhr1990 changed the title feat(driver): 新增清真云Open驱动,支持最新的轻量SDK feat(driver): Add Halalcloud Open driver, fix #1255 Oct 5, 2025
Copy link
Member

@jyxjjj jyxjjj left a comment

Choose a reason for hiding this comment

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

我们还不准备升级Go版本到24

@jyxjjj jyxjjj requested a review from Copilot October 6, 2025 01:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new HalalCloud Open driver that supports user-level ClientID/ClientSecret authentication without requiring login, provides direct file download with 302 redirects, and implements file upload functionality to fix issue #1255.

  • Adds complete HalalCloudOpen driver implementation with SDK-based API integration
  • Implements file operations (list, upload, download, move, copy, rename, delete) and direct link generation
  • Integrates authentication using client credentials and refresh tokens with automatic token management

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.

File Description
go.mod Updates Go version and adds HalalCloud SDK dependency
drivers/halalcloud_open/*.go Complete driver implementation including utilities, file operations, upload handling, and API interfaces
drivers/all.go Registers the new HalalCloudOpen driver

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jyxjjj
Copy link
Member

jyxjjj commented Oct 6, 2025

我们使用了logrus,且代码中部分日志实际上为DEBUG级,并非需要直接输出为INFO。

zzzhr1990 and others added 2 commits October 6, 2025 16:02
Downgrade Go version from 1.24.2 to 1.23.4

Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
* Removed unnecessary comments
* Downgraded the Go version to 1.23.4.
* Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
Copy link
Contributor Author

@zzzhr1990 zzzhr1990 left a comment

Choose a reason for hiding this comment

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

  • Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety.
  • Downgraded the Go version to 1.23.4.

@zzzhr1990 zzzhr1990 requested a review from jyxjjj October 6, 2025 08:09
KirCute and others added 4 commits October 6, 2025 16:53
Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety.

Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
Change required for RefreshToken, If using a personal API approach, the RefreshToken is not required.

Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
Copy link
Contributor Author

@zzzhr1990 zzzhr1990 left a comment

Choose a reason for hiding this comment

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

change RefreshToken required to false.

@KirCute KirCute changed the title feat(driver): Add Halalcloud Open driver, fix #1255 feat(driver): add halalcloud_open driver Oct 6, 2025
@KirCute KirCute changed the title feat(driver): add halalcloud_open driver feat(drivers): add halalcloud_open driver Oct 6, 2025
@zzzhr1990
Copy link
Contributor Author

golang 版本已经降至 1.23.4

@jyxjjj jyxjjj requested review from KirCute and j2rong4cn October 9, 2025 16:22
@zzzhr1990 zzzhr1990 requested review from KirCute and Copilot October 10, 2025 12:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (4)

drivers/halalcloud_open/utils.go:1

  • Parameter name 'preix' should be 'prefix'.
package halalcloudopen

drivers/halalcloud_open/utils.go:1

  • Parameter name 'preix' should be 'prefix'.
package halalcloudopen

drivers/halalcloud_open/utils.go:1

  • Variable name 'preix' should be 'prefix'.
package halalcloudopen

drivers/halalcloud_open/utils.go:1

  • Variable name 'preix' should be 'prefix'.
package halalcloudopen

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

KirCute
KirCute previously approved these changes Oct 10, 2025
Copy link
Member

@KirCute KirCute left a comment

Choose a reason for hiding this comment

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

Copilot 说的 timeout 拼写问题可以改一下,别的我这看没问题了

@jyxjjj
Copy link
Member

jyxjjj commented Oct 10, 2025

拼写错误有好几个的,都改掉

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
@zzzhr1990
Copy link
Contributor Author

Copilot 说的 timeout 拼写问题可以改一下,别的我这看没问题了
感谢 已经修复

@zzzhr1990
Copy link
Contributor Author

拼写错误有好几个的,都改掉
已修改

KirCute
KirCute previously approved these changes Oct 11, 2025
jyxjjj
jyxjjj previously approved these changes Oct 11, 2025
@ILoveScratch2
Copy link
Member

其实上面都是细节问题,不改也行

ILoveScratch2
ILoveScratch2 previously approved these changes Oct 13, 2025
@zzzhr1990 zzzhr1990 dismissed stale reviews from ILoveScratch2, jyxjjj, and KirCute via bb4fdcb October 13, 2025 14:27
@zzzhr1990
Copy link
Contributor Author

其实上面都是细节问题,不改也行

指针的问题已经修改了,sync.Map 的那个 我还是觉得可能 sync.Map 相对于Map和锁更安全些(可能在写值的时候会忘记加锁)毕竟 sync.Map 能出的问题是类型转换失败,而这个很容易复现和排查。

@jyxjjj jyxjjj merged commit fb5094f into OpenListTeam:main Oct 14, 2025
@zzzhr1990 zzzhr1990 deleted the halal-cloud-new-sdk branch October 14, 2025 09:26
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.

[Feature] 6盘(HhalCloud)最新SDK支持302了 希望能添加

5 participants