Skip to content

Commit 6a2c267

Browse files
committed
review updates
1 parent 452d3ed commit 6a2c267

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

src/client/csfle/client_encryption.rs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Support for explicit encryption.
22
33
use crate::{
4-
bson::{Binary, Document},
4+
bson::Binary,
55
coll::options::CollectionOptions,
66
error::{Error, Result},
77
options::{ReadConcern, WriteConcern},
@@ -260,16 +260,46 @@ pub struct DataKeyOptions {
260260
pub key_material: Option<Vec<u8>>,
261261
}
262262

263+
/// A KMS-specific key used to encrypt data keys.
263264
#[derive(Serialize)]
264265
#[serde(rename_all = "camelCase", untagged)]
265266
#[non_exhaustive]
267+
#[allow(missing_docs)]
266268
pub enum MasterKey {
267269
Aws {
268270
region: String,
271+
/// The Amazon Resource Name (ARN) to the AWS customer master key (CMK).
269272
key: String,
273+
/// An alternate host identifier to send KMS requests to. May include port number. Defaults
274+
/// to "kms.<region>.amazonaws.com"
270275
endpoint: Option<String>,
271276
},
277+
Azure {
278+
/// Host with optional port. Example: "example.vault.azure.net".
279+
key_vault_endpoint: String,
280+
key_name: String,
281+
/// A specific version of the named key, defaults to using the key's primary version.
282+
key_version: Option<String>,
283+
},
284+
Gcp {
285+
project_id: String,
286+
location: String,
287+
key_ring: String,
288+
key_name: String,
289+
/// A specific version of the named key, defaults to using the key's primary version.
290+
key_version: Option<String>,
291+
/// Host with optional port. Defaults to "cloudkms.googleapis.com".
292+
endpoint: Option<String>,
293+
},
294+
/// Master keys are not applicable to `KmsProvider::Local`.
272295
Local,
296+
Kmip {
297+
/// keyId is the KMIP Unique Identifier to a 96 byte KMIP Secret Data managed object. If
298+
/// keyId is omitted, the driver creates a random 96 byte KMIP Secret Data managed object.
299+
key_id: Option<String>,
300+
/// Host with optional port.
301+
endpoint: Option<String>,
302+
},
273303
}
274304

275305
// #[non_exhaustive]
@@ -291,6 +321,10 @@ pub struct EncryptOptions {
291321
/// The key to use.
292322
pub key: EncryptKey,
293323
/// The encryption algorithm.
324+
///
325+
/// To insert or query with an "Indexed" encrypted payload, use a `Client` configured with
326+
/// `AutoEncryptionOptions`. `AutoEncryptionOptions.bypass_query_analysis may be true.
327+
/// `AutoEncryptionOptions.bypass_auto_encryption` must be false.
294328
pub algorithm: Algorithm,
295329
/// The contention factor.
296330
#[builder(default)]

src/gridfs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(dead_code, unused_variables)]
2+
// TODO(RUST-1395) Remove these allows.
23

34
pub mod options;
45

0 commit comments

Comments
 (0)