-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(139): Enhance 139 driver with user authentication and file batch operations #1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added support for password-based login in the 139 driver. - Introduced RootPath field to store the root directory path. - Updated Init method to handle family and group types more effectively. - Implemented new methods for handling file operations in family and group contexts. - Enhanced error handling and logging for better debugging. - Added new request and response structures for batch operations and document modifications. - Improved encryption and decryption methods for secure communication.
|
勾选框请删掉空格直接写 |
There was a problem hiding this 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 implements password-based authentication for the 139 cloud driver to address short authorization token validity periods. The implementation adds a multi-step login flow involving password hashing, session token exchange, and third-party authentication with AES encryption for secure communication.
Key Changes:
- Added username/password fields to the Addition struct for authentication
- Implemented a three-step password login flow with AES encryption/decryption utilities
- Enhanced error handling and logging throughout request methods
- Added support for batch operations (move, copy, rename) in family and group cloud types
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| drivers/139/meta.go | Added Username, Password, and MailCookies fields to Addition struct for authentication |
| drivers/139/driver.go | Integrated password login fallback in Init, added Move/Copy/Rename support for family/group clouds |
| drivers/139/util.go | Implemented password login flow (3 steps), AES encryption utilities, and new request handlers |
| drivers/139/types.go | Added new request/response types for batch operations and document modifications |
Comments suppressed due to low confidence (1)
drivers/139/util.go:1
- Magic string value for x-deviceinfo header lacks explanation. Add a comment explaining the format and purpose of this device information string.
package _139
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if createBatchOprTaskResp, ok := resp.(*CreateBatchOprTaskResp); ok { | ||
| log.Debugf("[139] CreateBatchOprTaskResp.Result.ResultCode: %s", createBatchOprTaskResp.Result.ResultCode) | ||
| if createBatchOprTaskResp.Result.ResultCode == "0" { | ||
| goto SUCCESS_PROCESS |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of goto statement reduces code readability and maintainability. Consider refactoring to use explicit return statements or conditional logic instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能跑就行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数if嵌套的有点太深了,我觉得如果能改成下面这种形式最好,不行就算了
if condition1 {
return nil, err
}
xxx, err := xxx
if err != nil {
return nil, err
}
yyy, ok := yyy
if !ok {
return nil, fmt.Errorf("xxx")
}
return res.Body(), nilThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数
if嵌套的有点太深了,我觉得如果能改成下面这种形式最好,不行就算了if condition1 { return nil, err } xxx, err := xxx if err != nil { return nil, err } yyy, ok := yyy if !ok { return nil, fmt.Errorf("xxx") } return res.Body(), nil
主要是本地环境删了,懒得测试了(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果能帮忙测试下改掉应该没问题
Co-authored-by: Copilot <[email protected]> Signed-off-by: UcnacDx2 <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: UcnacDx2 <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: UcnacDx2 <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: UcnacDx2 <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: UcnacDx2 <[email protected]>
|
换成 139 邮箱了? |
| Account string | ||
| ref *Yun139 | ||
| PersonalCloudHost string | ||
| RootPath string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个RootPath是在哪用到的,没找到
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没记错的话,是家庭云和共享群的复制和移动的接口用到的参数,如果没用到应该是写到一起了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该只是我没找到,我再看看
云盘本身的登录接口要短信验证,这是取巧的办法。 |
|
May a fix of #1680 |
Description / 描述
增加了账户密码登录的功能。
增加了家庭云和共享群的复制,移动功能。
更换了更快速的上传端点。
Motivation and Context / 背景
authorization有效期太短。
家庭云和共享群功能缺失,上传速度慢。
How Has This Been Tested? / 测试
使用本地 debug 进行密码登录流程验证(创建临时用户 -> 调用 loginWithPassword -> 检查 Cookie/Session)。
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。