Skip to content

chore: add Rust release directory #1479

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 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/library_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ jobs:
working-directory: ./${{ matrix.library }}/runtimes/rust/
shell: bash
run: |
cargo run --example main
cargo run --release --example main
1 change: 1 addition & 0 deletions DynamoDbEncryption/runtimes/rust/src/intercept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#![deny(warnings, unconditional_panic)]
#![deny(nonstandard_style)]
#![deny(clippy::all)]
#![allow(unused)]

use aws_sdk_dynamodb::{
config::{
Expand Down
36 changes: 18 additions & 18 deletions DynamoDbEncryption/runtimes/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ pub(crate) use crate::implementation_from_dafny::HMAC;
pub(crate) use crate::implementation_from_dafny::UTF8;
pub(crate) use crate::implementation_from_dafny::UUID;

pub mod aes_gcm;
pub mod aes_kdf_ctr;
pub mod concurrent_call;
pub mod dafny_libraries;
pub mod ddb;
pub mod digest;
pub mod ecdh;
pub mod ecdsa;
pub mod hmac;
pub(crate) mod aes_gcm;
pub(crate) mod aes_kdf_ctr;
pub(crate) mod concurrent_call;
pub(crate) mod dafny_libraries;
pub(crate) mod ddb;
pub(crate) mod digest;
pub(crate) mod ecdh;
pub(crate) mod ecdsa;
pub(crate) mod hmac;
pub mod intercept;
pub mod kms;
pub mod local_cmc;
pub mod random;
pub mod rsa;
pub mod sets;
pub mod software_externs;
pub mod storm_tracker;
pub mod time;
pub mod uuid;
pub(crate) mod kms;
pub(crate) mod local_cmc;
pub(crate) mod random;
pub(crate) mod rsa;
pub(crate) mod sets;
pub(crate) mod software_externs;
pub(crate) mod storm_tracker;
pub(crate) mod time;
pub(crate) mod uuid;
2 changes: 2 additions & 0 deletions releases/rust/db_esdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cargo.lock
target
35 changes: 35 additions & 0 deletions releases/rust/db_esdk/.gitignore~
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*.pem
Cargo.lock
src/aes_gcm.rs
src/aes_kdf_ctr.rs
src/client
src/client.rs
src/concurrent_call.rs
src/conversions
src/conversions.rs
src/dafny_libraries.rs
src/ddb.rs
src/deps
src/deps.rs
src/digest.rs
src/ecdh.rs
src/ecdsa.rs
src/error
src/error.rs
src/hmac.rs
src/implementation_from_dafny.rs
src/kms.rs
src/local_cmc.rs
src/operation
src/operation.rs
src/random.rs
src/rsa.rs
src/sets.rs
src/standard_library_conversions.rs
src/standard_library_externs.rs
src/storm_tracker.rs
src/time.rs
src/types
src/types.rs
src/uuid.rs
target
34 changes: 34 additions & 0 deletions releases/rust/db_esdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "aws-db-esdk"
version = "0.1.0"
edition = "2021"
rust-version = "1.80.0"
keywords = ["crypto", "cryptography", "security", "dynamodb", "ddb", "encryption", "client-side", "clientside"]
license = "ISC AND (Apache-2.0 OR ISC)"
description = "aws-db-esdk is a library for implementing client side encryption with DynamoDB."
homepage = "https://github.com/aws/aws-database-encryption-sdk-dynamodb/tree/main/releases/rust/db_esdk"
repository = "https://github.com/aws/aws-database-encryption-sdk-dynamodb/tree/main/releases/rust/db_esdk"
authors = ["AWS-CryptoTools"]
documentation = "https://docs.rs/crate/aws-db-esdk"
autoexamples = false
readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
aws-config = "1.5.10"
aws-lc-rs = "1.11.1"
aws-lc-sys = "0.23.1"
aws-sdk-dynamodb = "1.54.0"
aws-sdk-kms = "1.50.0"
aws-smithy-runtime-api = {version = "1.7.3", features = ["client"] }
aws-smithy-types = "1.2.9"
chrono = "0.4.38"
dafny_runtime = { path = "./dafny_runtime_rust"}
dashmap = "6.1.0"
pem = "3.0.4"
tokio = {version = "1.41.1", features = ["full"] }
uuid = { version = "1.11.0", features = ["v4"] }

[[example]]
name = "main"
65 changes: 65 additions & 0 deletions releases/rust/db_esdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# AWS Database Encryption SDK for DynamoDB

AWS Database Encryption SDK for DynamoDB

## Using the AWS Database Encryption SDK for DynamoDB for Rust

The AWS Database Encryption SDK for DynamoDB is available on [Crates.io](https://www.crates.io/).

## Building the AWS Database Encryption SDK for DynamoDB

To build, the AWS Database Encryption SDK for DynamoDB requires the most up to date version of [Dafny](https://github.com/dafny-lang/dafny) on your PATH.

You will also need to ensure that you fetch all submodules using either `git clone --recursive ...` when cloning the repository or `git submodule update --init` on an existing clone.

To setup your project to use the AWS Database Encryption SDK for DynamoDB in Rust, run:

```
cd DynamoDbEncryption
# Polymorph smithy to Rust
make polymorph_rust
# Transpile Dafny to Rust
make transpile_rust
# Build Project
cd runtimes/rust
cargo build
```

### (Optional) Set up the AWS Database Encryption SDK for DynamoDB to work with AWS KMS

If you set up the AWS Database Encryption SDK for DynamoDB to use the AWS KMS Keyring,
the AWS Database Encryption SDK for DynamoDB will make calls to AWS KMS on your behalf,
using the appropriate AWS SDK.

However, you must first set up AWS credentials for use with the AWS SDK.

## Testing the AWS Database Encryption SDK for DynamoDB for Rust

### Configure AWS credentials

To run the test suite you must first set up AWS credentials for use with the AWS SDK.
This is required in order to run the integration tests, which use a KMS Keyring against a publicly accessible KMS CMK.

### Run the tests

Run the test suite with:

```
cd AwsEncryptionSDK
make test_rust
```

Run tests on examples, to ensure they are up to date:

```
cd AwsEncryptionSDK/runtimes/rust/
cargo test --examples
```

Please look at the Examples on how to use the Encryption SDK in Rust [here](examples).

Please note that tests and test vectors require internet access and valid AWS credentials, since calls to KMS are made as part of the test workflow.

## License

This library is licensed under the Apache 2.0 License.
1 change: 1 addition & 0 deletions releases/rust/db_esdk/dafny_runtime_rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
9 changes: 9 additions & 0 deletions releases/rust/db_esdk/dafny_runtime_rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "dafny_runtime"
version = "0.1.0"
edition = "2021"

[dependencies]
once_cell = "1.18.0"
num = "0.4"
itertools = "0.11.0"
Loading
Loading