Skip to content

Commit dd3e69f

Browse files
authored
RUST-1795 Remove unstable from in-use encryption (#1191)
1 parent c152d3b commit dd3e69f

37 files changed

+104
-103
lines changed

.evergreen/azure-kms-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tokio = "1.28.1"
1010

1111
[dependencies.mongodb]
1212
path = "../.."
13-
features = ["in-use-encryption-unstable", "azure-kms"]
13+
features = ["in-use-encryption", "azure-kms"]

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ functions:
16071607
16081608
echo "Building test ... begin"
16091609
. ${PROJECT_DIRECTORY}/.evergreen/env.sh
1610-
cargo test get_exe_name --features in-use-encryption-unstable,gcp-kms -- --ignored
1610+
cargo test get_exe_name --features in-use-encryption,gcp-kms -- --ignored
16111611
cp $(cat exe_name.txt) test-contents/test-exe
16121612
echo "Building test ... end"
16131613

.evergreen/run-csfle-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -o xtrace
1010

1111
export CSFLE_TLS_CERT_DIR="${DRIVERS_TOOLS}/.evergreen/x509gen"
1212

13-
FEATURE_FLAGS+=("in-use-encryption-unstable" "aws-auth" "azure-kms")
13+
FEATURE_FLAGS+=("in-use-encryption" "aws-auth" "azure-kms")
1414

1515
if [[ "$OPENSSL" = true ]]; then
1616
FEATURE_FLAGS+=("openssl-tls")

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ zlib-compression = ["dep:flate2"]
5858
snappy-compression = ["dep:snap"]
5959

6060
# Enables support for client-side field level encryption and queryable encryption.
61-
# The In Use Encryption API is unstable and may have backwards-incompatible changes in minor version updates.
62-
in-use-encryption-unstable = ["dep:mongocrypt", "dep:rayon", "dep:num_cpus"]
61+
in-use-encryption = ["dep:mongocrypt", "dep:rayon", "dep:num_cpus"]
62+
# The in-use encryption API is stable; this is for backwards compatibility.
63+
in-use-encryption-unstable = ["in-use-encryption"]
6364

6465
# Enables support for emitting tracing events.
6566
# The tracing API is unstable and may have backwards-incompatible changes in minor version updates.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ features = ["sync"]
4444
| `zlib-compression` | Enable support for compressing messages with [`zlib`](https://zlib.net/). |
4545
| `zstd-compression` | Enable support for compressing messages with [`zstd`](http://facebook.github.io/zstd/). |
4646
| `snappy-compression` | Enable support for compressing messages with [`snappy`](http://google.github.io/snappy/). |
47-
| `in-use-encryption-unstable` | Enable support for client-side field level encryption and queryable encryption. This API is unstable and may be subject to breaking changes in minor releases. |
47+
| `in-use-encryption` | Enable support for client-side field level encryption and queryable encryption. |
4848
| `tracing-unstable` | Enable support for emitting [`tracing`](https://docs.rs/tracing/latest/tracing/) events. This API is unstable and may be subject to breaking changes in minor releases. |
4949
| `compat-3-0-0` | Required for future compatibility if default features are disabled. |
5050

src/action.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod client_options;
66
mod count;
77
mod create_collection;
88
mod create_index;
9-
#[cfg(feature = "in-use-encryption-unstable")]
9+
#[cfg(feature = "in-use-encryption")]
1010
pub mod csfle;
1111
mod delete;
1212
mod distinct;

src/action/bulk_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ where
120120
}
121121

122122
async fn execute_inner(mut self) -> Result<R> {
123-
#[cfg(feature = "in-use-encryption-unstable")]
123+
#[cfg(feature = "in-use-encryption")]
124124
if self.client.should_auto_encrypt().await {
125125
use mongocrypt::error::{Error as EncryptionError, ErrorKind as EncryptionErrorKind};
126126

src/action/create_collection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a> CreateCollection<'a> {
6464
change_stream_pre_and_post_images: crate::db::options::ChangeStreamPreAndPostImages,
6565
clustered_index: crate::db::options::ClusteredIndex,
6666
comment: bson::Bson,
67-
#[cfg(feature = "in-use-encryption-unstable")]
67+
#[cfg(feature = "in-use-encryption")]
6868
encrypted_fields: Document,
6969
);
7070

src/action/drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub struct DropCollection<'a> {
111111
impl<'a> DropCollection<'a> {
112112
option_setters!(options: DropCollectionOptions;
113113
write_concern: WriteConcern,
114-
#[cfg(feature = "in-use-encryption-unstable")]
114+
#[cfg(feature = "in-use-encryption")]
115115
encrypted_fields: bson::Document,
116116
);
117117

src/client.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pub mod action;
22
pub mod auth;
3-
#[cfg(feature = "in-use-encryption-unstable")]
3+
#[cfg(feature = "in-use-encryption")]
44
pub(crate) mod csfle;
55
mod executor;
66
pub mod options;
@@ -11,7 +11,7 @@ use std::{
1111
time::{Duration, Instant},
1212
};
1313

14-
#[cfg(feature = "in-use-encryption-unstable")]
14+
#[cfg(feature = "in-use-encryption")]
1515
pub use self::csfle::client_builder::*;
1616
use derivative::Derivative;
1717
use futures_core::Future;
@@ -123,7 +123,7 @@ struct ClientInner {
123123
options: ClientOptions,
124124
session_pool: ServerSessionPool,
125125
shutdown: Shutdown,
126-
#[cfg(feature = "in-use-encryption-unstable")]
126+
#[cfg(feature = "in-use-encryption")]
127127
csfle: tokio::sync::RwLock<Option<csfle::ClientState>>,
128128
#[cfg(test)]
129129
disable_command_events: AtomicBool,
@@ -159,7 +159,7 @@ impl Client {
159159
pending_drops: SyncMutex::new(IdSet::new()),
160160
executed: AtomicBool::new(false),
161161
},
162-
#[cfg(feature = "in-use-encryption-unstable")]
162+
#[cfg(feature = "in-use-encryption")]
163163
csfle: Default::default(),
164164
#[cfg(test)]
165165
disable_command_events: AtomicBool::new(false),
@@ -190,7 +190,7 @@ impl Client {
190190
/// # Ok(())
191191
/// # }
192192
/// ```
193-
#[cfg(feature = "in-use-encryption-unstable")]
193+
#[cfg(feature = "in-use-encryption")]
194194
pub fn encrypted_builder(
195195
client_options: ClientOptions,
196196
key_vault_namespace: crate::Namespace,
@@ -213,7 +213,7 @@ impl Client {
213213

214214
/// Whether commands sent via this client should be auto-encrypted.
215215
pub(crate) async fn should_auto_encrypt(&self) -> bool {
216-
#[cfg(feature = "in-use-encryption-unstable")]
216+
#[cfg(feature = "in-use-encryption")]
217217
{
218218
let csfle = self.inner.csfle.read().await;
219219
match *csfle {
@@ -225,13 +225,13 @@ impl Client {
225225
None => false,
226226
}
227227
}
228-
#[cfg(not(feature = "in-use-encryption-unstable"))]
228+
#[cfg(not(feature = "in-use-encryption"))]
229229
{
230230
false
231231
}
232232
}
233233

234-
#[cfg(all(test, feature = "in-use-encryption-unstable"))]
234+
#[cfg(all(test, feature = "in-use-encryption"))]
235235
pub(crate) async fn mongocryptd_spawned(&self) -> bool {
236236
self.inner
237237
.csfle
@@ -241,7 +241,7 @@ impl Client {
241241
.map_or(false, |cs| cs.exec().mongocryptd_spawned())
242242
}
243243

244-
#[cfg(all(test, feature = "in-use-encryption-unstable"))]
244+
#[cfg(all(test, feature = "in-use-encryption"))]
245245
pub(crate) async fn has_mongocryptd_client(&self) -> bool {
246246
self.inner
247247
.csfle
@@ -549,7 +549,7 @@ impl Client {
549549
&self.inner.topology
550550
}
551551

552-
#[cfg(feature = "in-use-encryption-unstable")]
552+
#[cfg(feature = "in-use-encryption")]
553553
pub(crate) async fn primary_description(&self) -> Option<crate::sdam::ServerDescription> {
554554
let start_time = Instant::now();
555555
let timeout = self
@@ -578,7 +578,7 @@ impl Client {
578578
}
579579
}
580580

581-
#[cfg(feature = "in-use-encryption-unstable")]
581+
#[cfg(feature = "in-use-encryption")]
582582
pub(crate) async fn auto_encryption_opts(
583583
&self,
584584
) -> Option<tokio::sync::RwLockReadGuard<'_, csfle::options::AutoEncryptionOptions>> {

0 commit comments

Comments
 (0)