You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesatee.apache.org by GitBox <gi...@apache.org> on 2019/12/03 19:35:43 UTC

[GitHub] [incubator-mesatee] mssun opened a new issue #116: Auto-generated `prost_generated/kms_proto.rs` file is not same as the file checked in the repo

mssun opened a new issue #116: Auto-generated `prost_generated/kms_proto.rs` file is not same as the file checked in the repo
URL: https://github.com/apache/incubator-mesatee/issues/116
 
 
   The generated `kms_proto.rs` file is not exact same with the source checked in the repo. After a fresh compilation, the diff is like this:
   
   ```
   diff --git a/mesatee_services/kms/proto/src/prost_generated/kms_proto.rs b/mesatee_services/kms/proto/src/prost_generated/kms_proto.rs
   index 44484d6..b78054a 100644
   --- a/mesatee_services/kms/proto/src/prost_generated/kms_proto.rs
   +++ b/mesatee_services/kms/proto/src/prost_generated/kms_proto.rs
   @@ -1,67 +1,75 @@
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct CreateKeyRequest {
   -    #[prost(enumeration = "EncType", required, tag = "1")]
   +    #[prost(enumeration="EncType", required, tag="1")]
        pub enc_type: i32,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct AeadConfig {
   -    #[prost(bytes, required, tag = "1")]
   +    #[prost(bytes, required, tag="1")]
        #[serde(with = "crate::base64_coder")]
        pub key: std::vec::Vec<u8>,
   -    #[prost(bytes, required, tag = "2")]
   +    #[prost(bytes, required, tag="2")]
        #[serde(with = "crate::base64_coder")]
        pub nonce: std::vec::Vec<u8>,
   -    #[prost(bytes, required, tag = "3")]
   +    #[prost(bytes, required, tag="3")]
        #[serde(with = "crate::base64_coder")]
        pub ad: std::vec::Vec<u8>,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct ProtectedFsConfig {
   -    #[prost(bytes, required, tag = "1")]
   +    #[prost(bytes, required, tag="1")]
        #[serde(with = "crate::base64_coder")]
        pub key: std::vec::Vec<u8>,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct KeyConfig {
   -    #[prost(oneof = "key_config::Config", tags = "1, 2")]
   +    #[prost(oneof="key_config::Config", tags="1, 2")]
        pub config: ::std::option::Option<key_config::Config>,
    }
    pub mod key_config {
   -    #[derive(
   -        Clone, PartialEq, ::prost::Oneof, serde_derive::Serialize, serde_derive::Deserialize,
   -    )]
   +    #[derive(Clone, PartialEq, ::prost::Oneof)]
   +    #[derive(serde_derive::Serialize, serde_derive::Deserialize)]
        pub enum Config {
   -        #[prost(message, tag = "1")]
   +        #[prost(message, tag="1")]
            Aead(super::AeadConfig),
   -        #[prost(message, tag = "2")]
   +        #[prost(message, tag="2")]
            ProtectedFs(super::ProtectedFsConfig),
        }
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct CreateKeyResponse {
   -    #[prost(string, required, tag = "1")]
   +    #[prost(string, required, tag="1")]
        pub key_id: std::string::String,
   -    #[prost(message, required, tag = "2")]
   +    #[prost(message, required, tag="2")]
        pub config: KeyConfig,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct GetKeyRequest {
   -    #[prost(string, required, tag = "1")]
   +    #[prost(string, required, tag="1")]
        pub key_id: std::string::String,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct GetKeyResponse {
   -    #[prost(message, required, tag = "1")]
   +    #[prost(message, required, tag="1")]
        pub config: KeyConfig,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct DeleteKeyRequest {
   -    #[prost(string, required, tag = "1")]
   +    #[prost(string, required, tag="1")]
        pub key_id: std::string::String,
    }
   -#[derive(Clone, PartialEq, ::prost::Message, serde_derive::Serialize, serde_derive::Deserialize)]
   +#[derive(Clone, PartialEq, ::prost::Message)]
   +#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
    pub struct DeleteKeyResponse {
   -    #[prost(message, required, tag = "1")]
   +    #[prost(message, required, tag="1")]
        pub config: KeyConfig,
    }
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
   @@ -72,8 +80,7 @@ pub enum EncType {
        ProtectedFs = 1,
    }
    #[derive(Clone, serde_derive::Serialize, serde_derive::Deserialize, Debug)]
   -#[serde(tag = "type")]
   -pub enum KMSRequest {
   +#[serde(tag = "type")]pub enum KMSRequest {
        GetKey(GetKeyRequest),
        DelKey(DeleteKeyRequest),
        CreateKey(CreateKeyRequest),
   @@ -91,10 +98,7 @@ pub trait KMSService {
        fn create_key(req: CreateKeyRequest) -> mesatee_core::Result<CreateKeyResponse>;
        fn dispatch(&self, req: KMSRequest) -> mesatee_core::Result<KMSResponse> {
            match req {
   -            KMSRequest::GetKey(req) => Self::get_key(req).map(KMSResponse::GetKey),
   -            KMSRequest::DelKey(req) => Self::del_key(req).map(KMSResponse::DelKey),
   -            KMSRequest::CreateKey(req) => Self::create_key(req).map(KMSResponse::CreateKey),
   -        }
   +            KMSRequest::GetKey(req) => Self::get_key(req).map(KMSResponse::GetKey),            KMSRequest::DelKey(req) => Self::del_key(req).map(KMSResponse::DelKey),            KMSRequest::CreateKey(req) => Self::create_key(req).map(KMSResponse::CreateKey),        }
        }
    }
    pub struct KMSClient {
   @@ -106,10 +110,7 @@ impl KMSClient {
            let addr = target.addr;
            let channel = match target.desc {
                mesatee_core::config::OutboundDesc::Sgx(enclave_addr) => {
   -                mesatee_core::rpc::channel::SgxTrustedChannel::<KMSRequest, KMSResponse>::new(
   -                    addr,
   -                    enclave_addr,
   -                )?
   +                mesatee_core::rpc::channel::SgxTrustedChannel::<KMSRequest, KMSResponse>::new(addr, enclave_addr)?
                }
            };
            Ok(KMSClient { channel })
   @@ -121,9 +122,7 @@ impl KMSClient {
            let resp = self.channel.invoke(req)?;
            match resp {
                KMSResponse::GetKey(resp) => Ok(resp),
   -            _ => Err(mesatee_core::Error::from(
   -                mesatee_core::ErrorKind::RPCResponseError,
   -            )),
   +            _ => Err(mesatee_core::Error::from(mesatee_core::ErrorKind::RPCResponseError)),
            }
        }
    
   @@ -132,9 +131,7 @@ impl KMSClient {
            let resp = self.channel.invoke(req)?;
            match resp {
                KMSResponse::DelKey(resp) => Ok(resp),
   -            _ => Err(mesatee_core::Error::from(
   -                mesatee_core::ErrorKind::RPCResponseError,
   -            )),
   +            _ => Err(mesatee_core::Error::from(mesatee_core::ErrorKind::RPCResponseError)),
            }
        }
    
   @@ -143,9 +140,7 @@ impl KMSClient {
            let resp = self.channel.invoke(req)?;
            match resp {
                KMSResponse::CreateKey(resp) => Ok(resp),
   -            _ => Err(mesatee_core::Error::from(
   -                mesatee_core::ErrorKind::RPCResponseError,
   -            )),
   +            _ => Err(mesatee_core::Error::from(mesatee_core::ErrorKind::RPCResponseError)),
            }
        }
    }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mesatee.apache.org
For additional commands, e-mail: dev-help@mesatee.apache.org