Skip to content

refactor: remove enable_secure in FTP service. #709

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

Merged
merged 11 commits into from
Sep 26, 2022

Conversation

ClSlaid
Copy link
Contributor

@ClSlaid ClSlaid commented Sep 25, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

  1. remove enable_secure in FTP service builder
  2. if the endpoint begins with ftps://, the backend will use TLS secured connection

Note

now all endpoints should be prefixed with ftp:// and ftps://.

Signed-off-by: ClSlaid <[email protected]>
1. remove `enable_secure` in ftp service
2. if the endpoint begins with `ftps://`, enable_secure of suppaftp set
   to true

NOTE: now all endpoints should be prefixed `ftp://` and `ftps://`

Signed-off-by: ClSlaid <[email protected]>
@Xuanwo
Copy link
Member

Xuanwo commented Sep 25, 2022

Please update to branch before start new PR.

@ClSlaid ClSlaid marked this pull request as draft September 25, 2022 14:45
Copy link
Contributor

@ArberSephirotheca ArberSephirotheca left a comment

Choose a reason for hiding this comment

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

LGTM! I tested on my device and it works perfectly. Just a little suggestion, maybe we could add a bit more tests under test_build() for error condition like:

        // invalid scheme
        let mut builder = Builder::default();
        builder.endpoint("invalidscheme://ftp_server.local:8766");
        let b = builder.build();
        assert!(!b.is_ok());
        let expected = "backend error: (context: {}, source: endpoint scheme unsupported or invalid: \"invalidscheme\")";
        assert_eq!(b.unwrap_err().to_string(), expected);

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.

Mostly LGTM!

@Xuanwo Xuanwo marked this pull request as ready for review September 26, 2022 00:56
@ClSlaid ClSlaid marked this pull request as draft September 26, 2022 02:16
@Xuanwo
Copy link
Member

Xuanwo commented Sep 26, 2022

@ClSlaid are there other updates?

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

ClSlaid commented Sep 26, 2022

@ClSlaid are there other updates?

forgot to add test on the error message, resolving git conflicts.

@ClSlaid ClSlaid marked this pull request as ready for review September 26, 2022 02:30
@Xuanwo
Copy link
Member

Xuanwo commented Sep 26, 2022

forgot to add test on the error message

Please don't...

OpenDAL never relays on the error message.

@ClSlaid
Copy link
Contributor Author

ClSlaid commented Sep 26, 2022

forgot to add test on the error message

Please don't...

OpenDAL never relays on the error message.

test on error kinds then.

@Xuanwo Xuanwo merged commit 42958bd into apache:main Sep 26, 2022
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.

3 participants