Skip to content

Commit 7e492d7

Browse files
authored
chore: Release of 1.0.0 for Rust (#751)
1 parent fad048c commit 7e492d7

File tree

1,518 files changed

+145716
-127457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,518 files changed

+145716
-127457
lines changed

AwsEncryptionSDK/runtimes/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-esdk"
3-
version = "0.2.0"
3+
version = "1.0.0"
44
edition = "2021"
55
rust-version = "1.81.0"
66
keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"]

SUPPORT_POLICY.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ This table describes the current support status of each major version of the AWS
4343
- Current status
4444
- Next status
4545
- Next status date
46-
* - 0.x
47-
- Beta Version
48-
- End of Support
49-
- 2024-12-14
50-
* - 4.x
46+
* - 1.x
5147
- Generally Available
5248
-
5349
-

releases/rust/esdk/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-esdk"
3-
version = "0.2.0"
3+
version = "1.0.0"
44
edition = "2021"
55
rust-version = "1.81.0"
66
keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"]
@@ -16,21 +16,21 @@ readme = "README.md"
1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

1818
[dependencies]
19-
aws-config = "1.5.11"
20-
aws-lc-rs = "1.12.0"
21-
aws-lc-sys = "0.24.0"
22-
aws-sdk-dynamodb = "1.55.0"
23-
aws-sdk-kms = "1.51.0"
19+
aws-config = "1.5.15"
20+
aws-lc-rs = "1.12.2"
21+
aws-lc-sys = "0.25.0"
22+
aws-sdk-dynamodb = "1.62.0"
23+
aws-sdk-kms = "1.57.0"
2424
aws-smithy-runtime-api = {version = "1.7.3", features = ["client"] }
25-
aws-smithy-types = "1.2.10"
25+
aws-smithy-types = "1.2.12"
2626
chrono = "0.4.39"
2727
cpu-time = "1.0.0"
28-
dafny-runtime = "0.1.1"
28+
dafny-runtime = { version = "0.2.0", features = ["sync"] }
2929
dashmap = "6.1.0"
3030
pem = "3.0.4"
31-
rand = "0.8.5"
32-
tokio = {version = "1.42.0", features = ["full"] }
33-
uuid = { version = "1.11.0", features = ["v4"] }
31+
rand = "0.9.0"
32+
tokio = {version = "1.43.0", features = ["full"] }
33+
uuid = { version = "1.12.1", features = ["v4"] }
3434

3535
[[example]]
3636
name = "main"

releases/rust/esdk/examples/client_supplier/client_supplier_example.rs

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
use super::regional_role_client_supplier::RegionalRoleClientSupplier;
1919
use aws_esdk::client as esdk_client;
20-
use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig;
21-
use aws_esdk::material_providers::types::error::Error::AwsCryptographicMaterialProvidersException;
2220
use aws_esdk::material_providers::client as mpl_client;
21+
use aws_esdk::material_providers::types::error::Error::AwsCryptographicMaterialProvidersException;
2322
use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig;
2423
use aws_esdk::material_providers::types::DiscoveryFilter;
24+
use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig;
2525
use std::collections::HashMap;
2626

2727
pub async fn encrypt_and_decrypt_with_keyring(
@@ -46,8 +46,14 @@ pub async fn encrypt_and_decrypt_with_keyring(
4646
("encryption".to_string(), "context".to_string()),
4747
("is not".to_string(), "secret".to_string()),
4848
("but adds".to_string(), "useful metadata".to_string()),
49-
("that can help you".to_string(), "be confident that".to_string()),
50-
("the data you are handling".to_string(), "is what you think it is".to_string()),
49+
(
50+
"that can help you".to_string(),
51+
"be confident that".to_string(),
52+
),
53+
(
54+
"the data you are handling".to_string(),
55+
"is what you think it is".to_string(),
56+
),
5157
]);
5258

5359
// 3. Create a single MRK multi-keyring.
@@ -74,21 +80,25 @@ pub async fn encrypt_and_decrypt_with_keyring(
7480
// 4. Encrypt the data with the encryption_context using the encrypt_keyring.
7581
let plaintext = example_data.as_bytes();
7682

77-
let encryption_response = esdk_client.encrypt()
83+
let encryption_response = esdk_client
84+
.encrypt()
7885
.plaintext(plaintext)
7986
.keyring(mrk_keyring_with_client_supplier)
8087
.encryption_context(encryption_context.clone())
8188
.send()
8289
.await?;
8390

8491
let ciphertext = encryption_response
85-
.ciphertext
86-
.expect("Unable to unwrap ciphertext from encryption response");
92+
.ciphertext
93+
.expect("Unable to unwrap ciphertext from encryption response");
8794

8895
// 5. Demonstrate that the ciphertext and plaintext are different.
8996
// (This is an example for demonstration; you do not need to do this in your own code.)
90-
assert_ne!(ciphertext, aws_smithy_types::Blob::new(plaintext),
91-
"Ciphertext and plaintext data are the same. Invalid encryption");
97+
assert_ne!(
98+
ciphertext,
99+
aws_smithy_types::Blob::new(plaintext),
100+
"Ciphertext and plaintext data are the same. Invalid encryption"
101+
);
92102

93103
// 6. Create a MRK discovery multi-keyring with a custom client supplier.
94104
// A discovery MRK multi-keyring will be composed of
@@ -123,7 +133,8 @@ pub async fn encrypt_and_decrypt_with_keyring(
123133
// All of this is done serially, until a success occurs or all keyrings have failed
124134
// all (filtered) EDKs. KMS MRK Discovery Keyrings will attempt to decrypt
125135
// Multi Region Keys (MRKs) and regular KMS Keys.
126-
let decryption_response = esdk_client.decrypt()
136+
let decryption_response = esdk_client
137+
.decrypt()
127138
.ciphertext(ciphertext)
128139
.keyring(mrk_discovery_client_supplier_keyring)
129140
// Provide the encryption context that was supplied to the encrypt method
@@ -132,13 +143,16 @@ pub async fn encrypt_and_decrypt_with_keyring(
132143
.await?;
133144

134145
let decrypted_plaintext = decryption_response
135-
.plaintext
136-
.expect("Unable to unwrap plaintext from decryption response");
146+
.plaintext
147+
.expect("Unable to unwrap plaintext from decryption response");
137148

138149
// 8. Demonstrate that the decrypted plaintext is identical to the original plaintext.
139150
// (This is an example for demonstration; you do not need to do this in your own code.)
140-
assert_eq!(decrypted_plaintext, aws_smithy_types::Blob::new(plaintext),
141-
"Decrypted plaintext should be identical to the original plaintext. Invalid decryption");
151+
assert_eq!(
152+
decrypted_plaintext,
153+
aws_smithy_types::Blob::new(plaintext),
154+
"Decrypted plaintext should be identical to the original plaintext. Invalid decryption"
155+
);
142156

143157
// 9. Test the Missing Region Exception
144158
// (This is an example for demonstration; you do not need to do this in your own code.)
@@ -153,8 +167,10 @@ pub async fn encrypt_and_decrypt_with_keyring(
153167
// Swallow the exception
154168
// (This is an example for demonstration; you do not need to do this in your own code.)
155169
match mrk_discovery_client_supplier_keyring_missing_region {
156-
Ok(_) => panic!("Decryption using discovery keyring with missing region MUST \
157-
raise AwsCryptographicMaterialProvidersException"),
170+
Ok(_) => panic!(
171+
"Decryption using discovery keyring with missing region MUST \
172+
raise AwsCryptographicMaterialProvidersException"
173+
),
158174
Err(AwsCryptographicMaterialProvidersException { message: _e }) => (),
159175
_ => panic!("Unexpected error type"),
160176
}
@@ -180,7 +196,8 @@ pub async fn test_encrypt_and_decrypt_with_keyring() -> Result<(), crate::BoxErr
180196
utils::TEST_MRK_KEY_ID_US_EAST_1,
181197
utils::TEST_DEFAULT_KMS_KEY_ACCOUNT_ID,
182198
aws_regions,
183-
).await?;
199+
)
200+
.await?;
184201

185202
Ok(())
186203
}

releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
use super::regional_role_client_supplier_config;
45
use aws_config::Region;
5-
use aws_esdk::material_providers::types::ClientSupplier;
6+
use aws_esdk::com_amazonaws_kms::client::Client as kms_client;
67
use aws_esdk::material_providers::operation::get_client::GetClientInput;
78
use aws_esdk::material_providers::types::error::Error;
8-
use aws_esdk::com_amazonaws_kms::client::Client as kms_client;
9-
use super::regional_role_client_supplier_config;
9+
use aws_esdk::material_providers::types::ClientSupplier;
1010

1111
/*
1212
Example class demonstrating an implementation of a custom client supplier.
@@ -24,7 +24,8 @@ impl ClientSupplier for RegionalRoleClientSupplier {
2424

2525
if !region_iam_role_map.contains_key(&region) {
2626
return Err(Error::AwsCryptographicMaterialProvidersException {
27-
message: format!("Region {} is not supported by this client supplier", region).to_string(),
27+
message: format!("Region {} is not supported by this client supplier", region)
28+
.to_string(),
2829
});
2930
}
3031

0 commit comments

Comments
 (0)