Skip to content

Commit d173dee

Browse files
authored
Merge pull request #76 from cipherstash/getters-on-prepared
Add getter functions on `PreparedRecord` and `PreparedDelete`
2 parents 379cdb5 + 7c30b04 commit d173dee

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/crypto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use thiserror::Error;
2020

2121
pub use b64_encode::*;
2222
pub use sealed::{SealedTableEntry, UnsealSpec};
23-
pub use sealer::Sealer;
23+
pub use sealer::{Sealer, UnsealedIndex};
2424
pub use unsealed::Unsealed;
2525

2626
/// In order to stop indexes from exploding with indexes on large strings, cap the number of terms

src/encrypted_table/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ impl PreparedDelete {
132132
pub fn prepared_primary_key(&self) -> PreparedPrimaryKey {
133133
self.primary_key.clone()
134134
}
135+
136+
pub fn protected_indexes(&self) -> &[(Cow<'static, str>, IndexType)] {
137+
&self.protected_indexes
138+
}
135139
}
136140

137141
impl PreparedRecord {
@@ -165,6 +169,10 @@ impl PreparedRecord {
165169
.map(|(key, attr)| (key.as_str(), attr))
166170
}
167171

172+
pub fn unsealed_indexes(&self) -> &[UnsealedIndex] {
173+
&self.sealer.unsealed_indexes
174+
}
175+
168176
pub fn prepare_record<R>(record: R) -> Result<Self, SealError>
169177
where
170178
R: Searchable + Identifiable,
@@ -224,6 +232,10 @@ impl PreparedRecord {
224232
pub fn type_name(&self) -> &str {
225233
&self.sealer.type_name
226234
}
235+
236+
pub fn protected_indexes(&self) -> &[(Cow<'static, str>, IndexType)] {
237+
&self.protected_indexes
238+
}
227239
}
228240

229241
impl DynamoRecordPatch {

0 commit comments

Comments
 (0)