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

rewrite kms with prost #112

Merged
merged 8 commits into from
Dec 3, 2019
Merged

rewrite kms with prost #112

merged 8 commits into from
Dec 3, 2019

Conversation

litongxin1991
Copy link
Contributor

Description

Rewrite kms with prost:

  1. support both AEAD and ProtectedFs
  2. generate service trait and client automatically from proto file. Prior crate KMS client is now removed.
  3. compatible with current RPC framework. Passed all the tests.

Proto file: mesatee_services/kms/proto/src/kms.proto
Generated file: mesatee_services/kms/proto/src/prost_generated/kms_proto.rs

API Document will be updated later.

Type of change (select applied and DELETE the others)

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

CI. http://ci.mesalock-linux.org/litongxin1991/incubator-mesatee/21

Checklist (check ALL before submitting PR, even not applicable)

  • Fork the repo and create your branch from master.
  • If you've added code that should be tested, add tests.
  • If you've changed APIs, update the documentation.
  • Ensure the tests pass (see CI results).
  • Make sure your code lints/format.

mesatee_core/src/error.rs Outdated Show resolved Hide resolved
mesatee_services/kms/sgx_trusted_lib/src/kms.rs Outdated Show resolved Hide resolved
mesatee_services/kms/sgx_trusted_lib/src/kms.rs Outdated Show resolved Hide resolved
mesatee_services/kms/sgx_trusted_lib/src/kms.rs Outdated Show resolved Hide resolved
mesatee_services/kms/sgx_trusted_lib/src/kms.rs Outdated Show resolved Hide resolved
mesatee_services/tdfs/internal/client/src/tdfs_client.rs Outdated Show resolved Hide resolved
mesatee_services/tdfs/sgx_trusted_lib/src/tdfs_external.rs Outdated Show resolved Hide resolved
mesatee_services/tdfs/sgx_trusted_lib/src/tdfs_external.rs Outdated Show resolved Hide resolved
mesatee_services/tdfs/sgx_trusted_lib/src/tdfs_external.rs Outdated Show resolved Hide resolved
mesatee_services/tdfs/sgx_trusted_lib/src/tdfs_internal.rs Outdated Show resolved Hide resolved
@@ -12,6 +12,9 @@ mesalock_sgx = ["sgx_tstd", "mesatee_core/mesalock_sgx"]
cov = ["sgx_cov"]

[dependencies]
prost = { version = "0.5.0" }
bytes = { version = ">= 0.4.12"} # unix app depends on 0.4.12, while sgx lib depends on 0.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note: the revelent PR on prost is https://github.com/danburkert/prost/pull/246 . Once it's merged, I'll upgrade the forked prost.

@litongxin1991
Copy link
Contributor Author

Copy link
Member

@mssun mssun left a comment

Choose a reason for hiding this comment

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

Can we use raw string literal but not escape characters?

Refer to: https://rahul-thakoor.github.io/rust-raw-string-literals/

mesatee_services/kms/proto/build.rs Outdated Show resolved Hide resolved
mesatee_services/kms/proto/build.rs Outdated Show resolved Hide resolved
@litongxin1991
Copy link
Contributor Author

Can we use raw string literal but not escape characters?

Refer to: https://rahul-thakoor.github.io/rust-raw-string-literals/

Do you mean escape characters in prost_build_genreator.rs, like impl {} {{?

Escape characters are still needed when we use raw strings, because the escape characters are caused by format!

@mssun
Copy link
Member

mssun commented Dec 2, 2019

Can we use raw string literal but not escape characters?
Refer to: https://rahul-thakoor.github.io/rust-raw-string-literals/

Do you mean escape characters in prost_build_genreator.rs, like impl {} {{?

Escape characters are still needed when we use raw strings, because the escape characters are caused by format!

Ok, I understand. Thanks for the explanation.

@litongxin1991
Copy link
Contributor Author

Can we use raw string literal but not escape characters?
Refer to: https://rahul-thakoor.github.io/rust-raw-string-literals/

Do you mean escape characters in prost_build_genreator.rs, like impl {} {{?
Escape characters are still needed when we use raw strings, because the escape characters are caused by format!

Ok, I understand. Thanks for the explanation.

In prost_build_generator.rs, \" and \n are used. I will use the raw string to avoid these characters. Thanks for your advice.

}
buf.push_str(" }");
buf.push_str(LINE_ENDING);
buf.push_str(" }\n");
Copy link
Member

Choose a reason for hiding this comment

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

buf.push_str(" }\n"); => buf.push_str(" }");

@mssun mssun self-requested a review December 3, 2019 00:59
Copy link
Member

@mssun mssun left a comment

Choose a reason for hiding this comment

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

I'm ok with the PR. Thanks!

@mssun mssun merged commit 64d76d0 into apache:master Dec 3, 2019
@mssun
Copy link
Member

mssun commented Dec 3, 2019

Merged. Thank you!

jingleizhang added a commit to jingleizhang/incubator-mesatee that referenced this pull request Dec 3, 2019
[services/kms] Use protobuf to define and generate KMS protocol (apache#112)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants