-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add cargo support * use secretflow repository
- Loading branch information
1 parent
47a47f0
commit 54b2e06
Showing
5 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ build | |
dist | ||
*.egg-info | ||
.vscode | ||
python/secretflowapis | ||
python/secretflowapis | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "sdc_apis" | ||
version = "0.2.1-dev20240222" | ||
edition = "2021" | ||
description = "SecretFlow Data Capsule apis proto generated Rust" | ||
readme = "README.md" | ||
repository = "https://github.com/secretflow/secure-data-capsule-apis.git" | ||
license-file = "LICENSE" | ||
include = ["secretflowapis", "lib.rs", "build.rs"] | ||
|
||
|
||
[lib] | ||
name = "sdc_apis" | ||
path = "lib.rs" | ||
|
||
[dependencies] | ||
tonic = "0.9.2" | ||
prost = "0.11" | ||
prost-types = "0.11.1" | ||
serde = { version = "1.0", features = ["derive"] } | ||
prost-wkt = "0.4" | ||
prost-wkt-types = "0.4" | ||
|
||
[build-dependencies] | ||
tonic-build = "0.9.2" | ||
prost-wkt-build = "0.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 Ant Group Co., Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
// compile protobuf | ||
tonic_build::configure() | ||
.type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]") | ||
.field_attribute("protected_header", "#[serde(rename=\"protected\")]") | ||
.field_attribute(".secretflowapis.v2.sdc", "#[serde(default)]") | ||
.extern_path(".google.protobuf.Any", "::prost_wkt_types::Any") | ||
.compile( | ||
&["secretflowapis/v2/sdc/capsule_manager/capsule_manager.proto"], | ||
&["."], // specify the root location to search proto dependencies | ||
)?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2023 Ant Group Co., Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
pub mod secretflowapis { | ||
pub mod v2 { | ||
tonic::include_proto!("secretflowapis.v2"); | ||
pub mod sdc { | ||
tonic::include_proto!("secretflowapis.v2.sdc"); | ||
pub mod capsule_manager { | ||
tonic::include_proto!("secretflowapis.v2.sdc.capsule_manager"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters