Skip to content
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

feat(icloud): Add basic Apple iCloud Drive support #3980

Merged
merged 23 commits into from
Jan 19, 2024
Merged

Conversation

bokket
Copy link
Contributor

@bokket bokket commented Jan 15, 2024

part #2627
passed in local.
深度截图_选择区域_20240115105903

Signed-off-by: bokket <[email protected]>
@JasCodes
Copy link

@bokket Awesome effort, hope this gets merged

@bokket
Copy link
Contributor Author

bokket commented Jan 15, 2024

@bokket Awesome effort, hope this gets merged

just achieve Read and state method.write need upload is a little complicated.Maybe can make up next month

@Xuanwo
Copy link
Member

Xuanwo commented Jan 15, 2024

Hi, please install typos and make our types check happy first.

core/src/services/icloud/client.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Show resolved Hide resolved
const AUTH_HEADERS: [(&str, &str); 7] = [
(
"X-Apple-OAuth-Client-Id",
"d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d",
Copy link
Member

Choose a reason for hiding this comment

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

Where does this key come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Please add in comments so the maintainer knows where it's from.

core/src/services/icloud/session.rs Outdated Show resolved Hide resolved
core/src/services/icloud/session.rs Outdated Show resolved Hide resolved
core/src/services/icloud/session.rs Outdated Show resolved Hide resolved
core/src/services/mod.rs Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Member

Xuanwo commented Jan 15, 2024

Hi, please install typos and make our types check happy first.

If hsa is not a typo, please add it into the ignore list with comment to explain it.

@bokket
Copy link
Contributor Author

bokket commented Jan 15, 2024

Hi, please install typos and make our types check happy first.

If hsa is not a typo, please add it into the ignore list with comment to explain it.

Looks well, let's continue?

.typos.toml Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/core.rs Outdated Show resolved Hide resolved
core/src/services/icloud/core.rs Outdated Show resolved Hide resolved
core/src/services/icloud/drive.rs Outdated Show resolved Hide resolved
@Xuanwo Xuanwo changed the title feat(iCloud):Add Apple iCloud Drive support feat(icloud): Add basic Apple iCloud Drive support Jan 16, 2024
@Xuanwo
Copy link
Member

Xuanwo commented Jan 16, 2024

Hi, path cache has been added in main, maybe you want to refactor by it instead?

@bokket
Copy link
Contributor Author

bokket commented Jan 16, 2024

Hi, path cache has been added in main, maybe you want to refactor by it instead?

Let me briefly review path_cache

@bokket
Copy link
Contributor Author

bokket commented Jan 17, 2024

icloud will only list the directory, so we need to let the path_cache support to return parent_id instead of not only returning self_id.
The current cache : path->parent_id,return self_id.
The refactored cache: path->self_id,return self_id.The interface insert is not exposed.

parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:a5e90ada-46b4-4f83-ae75-3fe1bce01ca3
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:Some("FILE::com.apple.CloudDocs::3DE26BDF-DC8F-4DDA-98C0-24E52F75587C") | name:normal_file.txt
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:Some("FILE::com.apple.CloudDocs::468C2835-A0BF-4C7A-B615-FE939C0C9A36") | name:special_file  !@#$%^&()_+-=;',.txt
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:73a1d5b6-d023-47f7-ac96-6362b2217925
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:fff769a8-132e-48ca-b3ec-5b18d4237530
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:ba3996a2-8c0c-4b42-a65b-e8f1bb0efc15
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/
parent_id:FOLDER::com.apple.CloudDocs::root| path_cache:None | name:f610d966-0256-468b-88ad-5d49098a5321/

I want to customize the cache of Insert format

@Xuanwo
Copy link
Member

Xuanwo commented Jan 17, 2024

icloud will only list the directory, so we need to let the path_cache support to return parent_id instead of not only returning self_id.

I'm confused. To find the parent of a/b/c or a/b/d/, can't we simply look up the ID of a/b/?

@bokket
Copy link
Contributor Author

bokket commented Jan 17, 2024

icloud will only list the directory, so we need to let the path_cache support to return parent_id instead of not only returning self_id.

I'm confused. To find the parent of a/b/c or a/b/d/, can't we simply look up the ID of a/b/?

Ok. I don’t know why / is an extra layer of uuid directory below, puts me into a misunderstanding.

core/src/services/icloud/drive.rs Outdated Show resolved Hide resolved
core/src/services/icloud/client.rs Outdated Show resolved Hide resolved
core/src/services/icloud/core.rs Outdated Show resolved Hide resolved
core/src/services/icloud/backend.rs Outdated Show resolved Hide resolved
core/src/services/icloud/client.rs Outdated Show resolved Hide resolved
core/src/services/icloud/client.rs Outdated Show resolved Hide resolved
core/src/services/icloud/core.rs Outdated Show resolved Hide resolved
core/src/services/icloud/core.rs Outdated Show resolved Hide resolved
core/src/services/icloud/drive.rs Outdated Show resolved Hide resolved
core/src/services/icloud/drive.rs Outdated Show resolved Hide resolved
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Some details could be polished in later PRs.

@Xuanwo
Copy link
Member

Xuanwo commented Jan 19, 2024

Hello @bokket, could you address the conflicts?

Signed-off-by: bokket <[email protected]>
Signed-off-by: bokket <[email protected]>
@bokket
Copy link
Contributor Author

bokket commented Jan 19, 2024

Hello @bokket, could you address the conflicts?

I solved manually.

@Xuanwo Xuanwo merged commit 980f25b into apache:main Jan 19, 2024
189 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants