diff --git a/languages/golang/encrypt/guest/tests/leak.rs b/languages/golang/encrypt/guest/tests/leak.rs index 162e0d52d8..eacc81068d 100644 --- a/languages/golang/encrypt/guest/tests/leak.rs +++ b/languages/golang/encrypt/guest/tests/leak.rs @@ -81,6 +81,10 @@ fn vitur(status: u16) -> ViturRequestError { #[derive(Default)] struct Failing(FakeDataKeySource); +impl stack_kms::KeySourceKind for Failing { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Failing { async fn generate_keys( &self, diff --git a/languages/golang/encrypt/guest/tests/native_ops.rs b/languages/golang/encrypt/guest/tests/native_ops.rs index a4c90af2e3..20deece95d 100644 --- a/languages/golang/encrypt/guest/tests/native_ops.rs +++ b/languages/golang/encrypt/guest/tests/native_ops.rs @@ -59,6 +59,10 @@ struct Counting { retrieve_calls: AtomicUsize, } +impl stack_kms::KeySourceKind for Counting { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Counting { async fn generate_keys( &self, diff --git a/packages/eql/tests/encryption/tests/common/mod.rs b/packages/eql/tests/encryption/tests/common/mod.rs index 2cca77e0d0..3b58fcc35f 100644 --- a/packages/eql/tests/encryption/tests/common/mod.rs +++ b/packages/eql/tests/encryption/tests/common/mod.rs @@ -29,6 +29,10 @@ pub struct RecordingKeySource { inner: FakeDataKeySource, calls: Arc>, } +impl stack_kms::KeySourceKind for RecordingKeySource { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for RecordingKeySource { async fn generate_keys( &self, diff --git a/packages/eql/tests/encryption/tests/heap_hygiene.rs b/packages/eql/tests/encryption/tests/heap_hygiene.rs index 9c6cae80b2..3e564efefa 100644 --- a/packages/eql/tests/encryption/tests/heap_hygiene.rs +++ b/packages/eql/tests/encryption/tests/heap_hygiene.rs @@ -438,6 +438,10 @@ impl Stalling { } } +impl stack_kms::KeySourceKind for Stalling { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Stalling { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/CHANGELOG.md b/packages/stack-encrypt/CHANGELOG.md index d73a5740c0..f21044b557 100644 --- a/packages/stack-encrypt/CHANGELOG.md +++ b/packages/stack-encrypt/CHANGELOG.md @@ -410,6 +410,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking +- **A key source of your own states its kind.** `kms::DataKeySource`, + `kms::IndexKeySource` and `kms::CredentialKeySource` each require + `kms::KeySourceKind`, so that a type cannot be both kinds of key source. + To migrate, add one impl to each key source you wrote, such as a test + double. A cipher built with `auth_strategy(..)` or over + `kms::StackKms`, `kms::FakeDataKeySource` or + `kms::FakeCredentialKeySource` needs no change. + + ```rust + impl stack_encrypt::kms::KeySourceKind for MyKeySource { + // `kms::CredentialPerCall` for a `CredentialKeySource`. + type Kind = stack_encrypt::kms::OwnIdentity; + } + ``` + - **`.kms(source)` returns a builder in its own state** (#1708). This follows from telling the two kinds of key source apart in the types (`KeySource`). `StackCipher::builder().kms(source)` returns a diff --git a/packages/stack-encrypt/src/credential.rs b/packages/stack-encrypt/src/credential.rs index 78609431b4..738e9d7c25 100644 --- a/packages/stack-encrypt/src/credential.rs +++ b/packages/stack-encrypt/src/credential.rs @@ -108,7 +108,9 @@ mod sealed { /// compiler works it out from the key source. /// /// Sealed: it is implemented for every key source of either kind, and for -/// nothing else. To supply a key source, implement the traits of its kind. +/// nothing else. To supply a key source, implement the traits of its kind, +/// and state the kind ([`KeySourceKind`](stack_kms::KeySourceKind)). A key +/// source states one kind, so it is never both. That rule is Stack KMS's. pub trait KeySource: sealed::Sealed { /// The identity to load the default keyset as when the cipher is /// built, when no caller is present: the key source's own, or `None` diff --git a/packages/stack-encrypt/src/dynamic/record.rs b/packages/stack-encrypt/src/dynamic/record.rs index 1c50307034..584de1ec64 100644 --- a/packages/stack-encrypt/src/dynamic/record.rs +++ b/packages/stack-encrypt/src/dynamic/record.rs @@ -2913,6 +2913,10 @@ mod tests { retrieve_calls: AtomicUsize, } + impl stack_kms::KeySourceKind for Counting { + type Kind = stack_kms::OwnIdentity; + } + impl DataKeySource for Counting { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/src/target/pending.rs b/packages/stack-encrypt/src/target/pending.rs index 40e2b532d8..6ab0975239 100644 --- a/packages/stack-encrypt/src/target/pending.rs +++ b/packages/stack-encrypt/src/target/pending.rs @@ -1758,6 +1758,10 @@ mod tests { } } + impl stack_kms::KeySourceKind for CountingSource { + type Kind = stack_kms::OwnIdentity; + } + impl DataKeySource for CountingSource { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/audit.rs b/packages/stack-encrypt/tests/audit.rs index 6bed723337..850500235a 100644 --- a/packages/stack-encrypt/tests/audit.rs +++ b/packages/stack-encrypt/tests/audit.rs @@ -58,6 +58,10 @@ impl RecordingSource { } } +impl stack_encrypt::kms::KeySourceKind for RecordingSource { + type Kind = stack_encrypt::kms::OwnIdentity; +} + impl DataKeySource for RecordingSource { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/common/mod.rs b/packages/stack-encrypt/tests/common/mod.rs index 9fe1842226..da4593ce5e 100644 --- a/packages/stack-encrypt/tests/common/mod.rs +++ b/packages/stack-encrypt/tests/common/mod.rs @@ -121,6 +121,10 @@ impl CountingSource { } } +impl stack_kms::KeySourceKind for CountingSource { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for CountingSource { async fn generate_keys( &self, @@ -228,6 +232,10 @@ impl RecordingSource { } } +impl stack_kms::KeySourceKind for RecordingSource { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for RecordingSource { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/credential.rs b/packages/stack-encrypt/tests/credential.rs index 0a2acf8a34..5fdc8383bd 100644 --- a/packages/stack-encrypt/tests/credential.rs +++ b/packages/stack-encrypt/tests/credential.rs @@ -186,6 +186,10 @@ fn is_refusal(error: &Error, why: &str) -> bool { #[derive(Clone)] struct OwnIdentity(Source); +impl stack_encrypt::kms::KeySourceKind for OwnIdentity { + type Kind = stack_encrypt::kms::OwnIdentity; +} + impl DataKeySource for OwnIdentity { async fn generate_keys( &self, @@ -219,6 +223,10 @@ impl IndexKeySource for OwnIdentity { } } +impl stack_encrypt::kms::KeySourceKind for Source { + type Kind = stack_encrypt::kms::CredentialPerCall; +} + impl CredentialKeySource for Source { async fn generate_keys_with_credential( &self, diff --git a/packages/stack-encrypt/tests/frozen_bytes.rs b/packages/stack-encrypt/tests/frozen_bytes.rs index 9a22b5656b..e6d2d60315 100644 --- a/packages/stack-encrypt/tests/frozen_bytes.rs +++ b/packages/stack-encrypt/tests/frozen_bytes.rs @@ -263,6 +263,10 @@ async fn sealed_value_keyset_id_is_authenticated() { /// saturated length field that `from_bytes` no longer inverts. struct OversizedTagSource(FakeDataKeySource); +impl stack_kms::KeySourceKind for OversizedTagSource { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for OversizedTagSource { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/heap_hygiene.rs b/packages/stack-encrypt/tests/heap_hygiene.rs index bbbba539a3..011ab80aea 100644 --- a/packages/stack-encrypt/tests/heap_hygiene.rs +++ b/packages/stack-encrypt/tests/heap_hygiene.rs @@ -1398,6 +1398,10 @@ mod cancellation { } } + impl stack_kms::KeySourceKind for Stalling { + type Kind = stack_kms::OwnIdentity; + } + impl DataKeySource for Stalling { async fn generate_keys( &self, @@ -2185,6 +2189,10 @@ mod json_index { .copy_from_slice(key.key()); } + impl stack_kms::KeySourceKind for Recorded { + type Kind = stack_kms::OwnIdentity; + } + impl DataKeySource for Recorded { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/json_operators.rs b/packages/stack-encrypt/tests/json_operators.rs index 0500afa439..c2b9d27125 100644 --- a/packages/stack-encrypt/tests/json_operators.rs +++ b/packages/stack-encrypt/tests/json_operators.rs @@ -833,6 +833,10 @@ impl Shared { } } +impl stack_kms::KeySourceKind for Shared { + type Kind = stack_kms::CredentialPerCall; +} + impl stack_kms::CredentialKeySource for Shared { async fn generate_keys_with_credential( &self, diff --git a/packages/stack-encrypt/tests/keysets.rs b/packages/stack-encrypt/tests/keysets.rs index 7a845e3366..f24b4b7fcc 100644 --- a/packages/stack-encrypt/tests/keysets.rs +++ b/packages/stack-encrypt/tests/keysets.rs @@ -91,6 +91,10 @@ impl Observed { } } +impl stack_kms::KeySourceKind for Observed { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Observed { async fn generate_keys( &self, @@ -850,6 +854,10 @@ impl Reader { } } +impl stack_kms::KeySourceKind for Reader { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Reader { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/lifecycle_conformance.rs b/packages/stack-encrypt/tests/lifecycle_conformance.rs index 2fd96c42d1..1f3654e135 100644 --- a/packages/stack-encrypt/tests/lifecycle_conformance.rs +++ b/packages/stack-encrypt/tests/lifecycle_conformance.rs @@ -45,6 +45,10 @@ struct Source { observed: Arc, } +impl stack_kms::KeySourceKind for Source { + type Kind = stack_kms::OwnIdentity; +} + impl DataKeySource for Source { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/opaque_blob.rs b/packages/stack-encrypt/tests/opaque_blob.rs index 0d114cd4eb..8e8431e5ac 100644 --- a/packages/stack-encrypt/tests/opaque_blob.rs +++ b/packages/stack-encrypt/tests/opaque_blob.rs @@ -260,6 +260,10 @@ const FIXED_TAG: &[u8] = b"fixed-key-tag"; /// ciphertext sealed once can be pinned and opened by any later build. struct FixedKeySource(stack_kms::FakeDataKeySource); +impl stack_kms::KeySourceKind for FixedKeySource { + type Kind = stack_kms::OwnIdentity; +} + impl stack_kms::DataKeySource for FixedKeySource { async fn generate_keys( &self, diff --git a/packages/stack-encrypt/tests/scalar.rs b/packages/stack-encrypt/tests/scalar.rs index 4e611ddbce..3a568025af 100644 --- a/packages/stack-encrypt/tests/scalar.rs +++ b/packages/stack-encrypt/tests/scalar.rs @@ -516,6 +516,10 @@ struct FixedKeySource(stack_kms::FakeDataKeySource); const FIXED_KEY: [u8; 32] = *b"fixed-data-key-for-pinned-leaf!!"; const FIXED_IV: [u8; 16] = *b"fixed-iv-pinned!"; const FIXED_TAG: &[u8] = b"fixed-key-tag"; +impl stack_kms::KeySourceKind for FixedKeySource { + type Kind = stack_kms::OwnIdentity; +} + impl stack_kms::DataKeySource for FixedKeySource { async fn generate_keys( &self, diff --git a/packages/stack-kms/CHANGELOG.md b/packages/stack-kms/CHANGELOG.md index e554f75185..37fd4dd8d2 100644 --- a/packages/stack-kms/CHANGELOG.md +++ b/packages/stack-kms/CHANGELOG.md @@ -10,6 +10,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking - Requires stack-auth 0.44 and stack-profile 0.44. +- A key source states which kind it is, with the new `KeySourceKind` + trait. `DataKeySource` and `IndexKeySource` require the kind + `OwnIdentity`, and `CredentialKeySource` requires the kind + `CredentialPerCall`. A type states one kind, so a key source of both + kinds does not compile. Before, only the docs said a key source is one + kind or the other. To migrate, add one impl to each key source of your + own, such as a test double: + + ```rust + impl stack_kms::KeySourceKind for MyKeySource { + type Kind = stack_kms::OwnIdentity; + } + ``` + + `StackKms` needs no change: its kind is the kind of its auth strategy + (`stack_auth::StrategyKind`). The test doubles of this crate state + theirs. Re-exports `CredentialPerCall` beside `OwnIdentity`. ### Features diff --git a/packages/stack-kms/src/key_source.rs b/packages/stack-kms/src/key_source.rs index 757034587d..c37aa85606 100644 --- a/packages/stack-kms/src/key_source.rs +++ b/packages/stack-kms/src/key_source.rs @@ -10,7 +10,7 @@ use std::borrow::Cow; use std::future::Future; -use stack_auth::SecretToken; +use stack_auth::{CredentialPerCall, OwnIdentity, SecretToken}; use uuid::Uuid; use zerokms_protocol::{IdentifiedBy, UnverifiedContext}; @@ -19,6 +19,174 @@ use crate::key::{DataKey, DataKeyWithTag, IndexKey}; use crate::maybe_send::MaybeSend; use crate::payload::{GenerateKeyPayload, RetrieveKeyPayload}; +/// Which of the two kinds a key source is. +/// +/// A key source makes every request as itself, or as the caller whose +/// credential comes with the call. It is never both: a key source that had +/// both would make a call that forgot its credential as itself, and nobody +/// would know. This trait is what stops a type from being both. A type +/// implements it once, so it has one [`Kind`](Self::Kind): +/// +/// - [`OwnIdentity`], for a key source with an identity of its own. +/// [`DataKeySource`] and [`IndexKeySource`] require this kind. +/// - [`CredentialPerCall`], for a key source that takes a credential with +/// each call. [`CredentialKeySource`] requires this kind. +/// +/// Every key source states its kind, in one impl beside the traits of that +/// kind. [`StackKms`](crate::StackKms) does not choose: its kind is the kind +/// of its auth strategy ([`stack_auth::StrategyKind`]). +/// +/// Code built on a key source, such as Stack Encrypt, reads the kind from +/// which of the traits the key source has. It adds no rule of its own. +/// +// The examples wrap the test doubles, so they are in the docs only with +// `test-support`. +#[cfg_attr( + feature = "test-support", + doc = r#"# Example + +A key source of your own with an identity of its own. This one counts the +keyset loads of the key source it wraps: + +``` +use std::borrow::Cow; +use std::sync::atomic::{AtomicUsize, Ordering}; + +use stack_kms::{ + DataKey, DataKeySource, DataKeyWithTag, Error, FakeDataKeySource, GenerateKeyPayload, + IdentifiedBy, IndexKey, IndexKeySource, KeySourceKind, OwnIdentity, RetrieveKeyPayload, + UnverifiedContext, +}; +use uuid::Uuid; + +#[derive(Default)] +struct Counted { + inner: FakeDataKeySource, + loads: AtomicUsize, +} + +impl KeySourceKind for Counted { + type Kind = OwnIdentity; +} + +impl DataKeySource for Counted { + async fn generate_keys( + &self, + payloads: Vec>, + keyset_id: Option, + unverified_context: Option>, + ) -> Result, Error> { + self.inner.generate_keys(payloads, keyset_id, unverified_context).await + } + + async fn retrieve_keys( + &self, + payloads: Vec>, + keyset_id: Option, + unverified_context: Option<&UnverifiedContext>, + ) -> Result, Error> { + self.inner.retrieve_keys(payloads, keyset_id, unverified_context).await + } +} + +impl IndexKeySource for Counted { + async fn load_index_key( + &self, + keyset_id: Option, + ) -> Result<(Uuid, IndexKey), Error> { + self.loads.fetch_add(1, Ordering::Relaxed); + self.inner.load_index_key(keyset_id).await + } +} + +# async fn example() -> Result<(), Error> { +let source = Counted::default(); +let (keyset_id, _index_key) = source.load_index_key(None).await?; +# let _ = keyset_id; +assert_eq!(source.loads.load(Ordering::Relaxed), 1); +# Ok(()) +# } +# tokio::runtime::Builder::new_current_thread().build().unwrap().block_on(example()).unwrap(); +``` + +A key source of both kinds does not compile. `Both` says it has an identity +of its own, so it cannot also take a credential with each call: + +```compile_fail,E0271 +use std::borrow::Cow; + +use stack_kms::{ + CredentialKeySource, DataKey, DataKeyWithTag, Error, FakeCredentialKeySource, + GenerateKeyPayload, IdentifiedBy, IndexKey, KeySourceKind, OwnIdentity, RetrieveKeyPayload, + SecretToken, UnverifiedContext, +}; +use uuid::Uuid; + +#[derive(Default)] +struct Both { + inner: FakeCredentialKeySource, +} + +impl KeySourceKind for Both { + type Kind = OwnIdentity; +} + +impl CredentialKeySource for Both { + async fn generate_keys_with_credential( + &self, + credential: &SecretToken, + payloads: Vec>, + keyset_id: Option, + unverified_context: Option>, + ) -> Result, Error> { + self.inner + .generate_keys_with_credential(credential, payloads, keyset_id, unverified_context) + .await + } + + async fn retrieve_keys_with_credential( + &self, + credential: &SecretToken, + payloads: Vec>, + keyset_id: Option, + unverified_context: Option<&UnverifiedContext>, + ) -> Result, Error> { + self.inner + .retrieve_keys_with_credential(credential, payloads, keyset_id, unverified_context) + .await + } + + async fn load_index_key_with_credential( + &self, + credential: &SecretToken, + keyset_id: Option, + ) -> Result<(Uuid, IndexKey), Error> { + self.inner.load_index_key_with_credential(credential, keyset_id).await + } +} +```"# +)] +#[diagnostic::on_unimplemented( + message = "`{Self}` does not say which kind of key source it is", + label = "this key source has no `KeySourceKind`", + note = "a key source with an identity of its own (`DataKeySource`, `IndexKeySource`) implements `KeySourceKind` with `type Kind = OwnIdentity`", + note = "a key source that takes a credential with each call (`CredentialKeySource`) implements `KeySourceKind` with `type Kind = CredentialPerCall`" +)] +pub trait KeySourceKind { + /// [`OwnIdentity`] or [`CredentialPerCall`]. + type Kind; +} + +/// A ZeroKMS client is the kind of key source that its auth strategy is a +/// kind of strategy. stack-auth decides that, and a strategy is one kind. +impl KeySourceKind for crate::StackKms +where + C: stack_auth::AuthStrategyBounds, + &'static C: stack_auth::StrategyKind, +{ + type Kind = <&'static C as stack_auth::StrategyKind>::Kind; +} + /// The slice of ZeroKMS data-key functionality required to encrypt and decrypt: /// generating fresh data keys and re-deriving them for stored ciphertexts. /// @@ -31,15 +199,16 @@ use crate::payload::{GenerateKeyPayload, RetrieveKeyPayload}; /// (see [`MaybeSend`] for why). /// /// A source that implements this trait has an identity of its own, and -/// makes every request as that identity. A source that takes a credential -/// with each call implements [`CredentialKeySource`] instead, and not this -/// trait. +/// makes every request as that identity: it states the kind +/// [`OwnIdentity`] ([`KeySourceKind`]). A source that takes a credential +/// with each call implements [`CredentialKeySource`] instead, and cannot +/// implement this trait. #[diagnostic::on_unimplemented( message = "`{Self}` is not a key source with an identity of its own", label = "this makes a key request with no credential", note = "if `{Self}` takes a credential with each call (`CredentialKeySource`), pass one: in Stack Encrypt, call `.with_credential(..)` before `.await`" )] -pub trait DataKeySource { +pub trait DataKeySource: KeySourceKind { /// Generate one fresh data key per payload, in payload order. fn generate_keys( &self, @@ -74,7 +243,7 @@ pub trait DataKeySource { label = "this loads a keyset with no credential", note = "if `{Self}` takes a credential with each call (`CredentialKeySource`), pass one: in Stack Encrypt, call `.with_credential(..)` before `.await`" )] -pub trait IndexKeySource { +pub trait IndexKeySource: KeySourceKind { /// Load the index key for a keyset — identified by id or name, or the /// client's default keyset when `keyset_id` is `None`. Returns the /// resolved keyset id alongside the key, so callers pinning `None` or a @@ -103,7 +272,8 @@ pub trait IndexKeySource { /// `credential` added. An implementation must make the request with that /// credential, or fail. It must never fall back to another identity. /// -/// A key source is one kind or the other, never both: +/// A key source is one kind or the other, never both. [`KeySourceKind`] +/// holds that: a type states one kind, and each trait requires its own. /// /// - A source with an identity of its own (an access key, a saved login) /// implements [`DataKeySource`] and [`IndexKeySource`], and not this @@ -126,7 +296,7 @@ pub trait IndexKeySource { label = "this passes a credential to a key source that has an identity of its own", note = "a key source with an identity of its own makes every request as that identity. To make each request as its caller, build the key source over an auth strategy that takes a credential with each call, such as `OidcFederationStrategy::credential_per_call`" )] -pub trait CredentialKeySource { +pub trait CredentialKeySource: KeySourceKind { /// [`DataKeySource::generate_keys`], made with `credential`. fn generate_keys_with_credential( &self, @@ -407,6 +577,10 @@ mod fake { } } + impl KeySourceKind for FakeDataKeySource { + type Kind = OwnIdentity; + } + impl IndexKeySource for FakeDataKeySource { async fn load_index_key( &self, @@ -529,6 +703,10 @@ mod fake { } } + impl KeySourceKind for FakeCredentialKeySource { + type Kind = CredentialPerCall; + } + impl CredentialKeySource for FakeCredentialKeySource { async fn generate_keys_with_credential( &self, @@ -640,6 +818,10 @@ mod deterministic { } } + impl super::KeySourceKind for DeterministicSource { + type Kind = super::OwnIdentity; + } + impl DataKeySource for DeterministicSource { async fn generate_keys( &self, diff --git a/packages/stack-kms/src/lib.rs b/packages/stack-kms/src/lib.rs index 2258eed3f3..d7c9d0a7cd 100644 --- a/packages/stack-kms/src/lib.rs +++ b/packages/stack-kms/src/lib.rs @@ -134,11 +134,11 @@ pub use stack_auth::{diagnostic, ErrorPayload}; /// dependency on `stack-auth` to pass one. pub use stack_auth::SecretToken; -/// The identity of a key source that has one of its own -/// ([`DataKeySource`] and [`IndexKeySource`]). It is stack-auth's type, for -/// a strategy of that kind, re-exported so that code generic over the two -/// kinds of key source needs no direct dependency on `stack-auth`. -pub use stack_auth::OwnIdentity; +/// The two kinds of key source ([`KeySourceKind`]): one with an identity of +/// its own, and one that takes a credential with each call. They are +/// stack-auth's types, for the two kinds of strategy, re-exported so that a +/// key source needs no direct dependency on `stack-auth` to state its kind. +pub use stack_auth::{CredentialPerCall, OwnIdentity}; // Key material pub use key::{ClientKey, DataKey, DataKeyWithTag, IndexKey, V1KeySet}; @@ -146,7 +146,7 @@ pub use key::{ClientKey, DataKey, DataKeyWithTag, IndexKey, V1KeySet}; // Key source abstractions (production = `StackKms`; tests = `FakeDataKeySource`) #[cfg(feature = "test-support")] pub use key_source::DeterministicSource; -pub use key_source::{CredentialKeySource, DataKeySource, IndexKeySource}; +pub use key_source::{CredentialKeySource, DataKeySource, IndexKeySource, KeySourceKind}; #[cfg(feature = "test-support")] pub use key_source::{FakeCredentialKeySource, FakeDataKeySource};