|
1 | 1 | use crate::{ |
2 | | - async_map_somes::async_map_somes, crypto::attrs::FlattenedEncryptedAttributes, encrypted_table::TableEntry, traits::{ReadConversionError, TableAttribute, WriteConversionError}, Decryptable |
| 2 | + crypto::attrs::FlattenedEncryptedAttributes, encrypted_table::TableEntry, traits::{ReadConversionError, WriteConversionError}, Decryptable |
3 | 3 | }; |
4 | 4 | use aws_sdk_dynamodb::{primitives::Blob, types::AttributeValue}; |
5 | 5 | use cipherstash_client::{ |
6 | 6 | credentials::{service_credentials::ServiceToken, Credentials}, |
7 | | - encryption::{Encryption, Plaintext}, |
| 7 | + encryption::Encryption, |
8 | 8 | }; |
9 | 9 | use itertools::Itertools; |
10 | | -use std::{borrow::Cow, collections::HashMap, ops::Deref}; |
| 10 | +use std::{borrow::Cow, collections::HashMap}; |
11 | 11 |
|
12 | | -use super::{attrs::NormalizedProtectedAttributes, sealer::Sealed, SealError, Unsealed}; |
| 12 | +use super::{attrs::NormalizedProtectedAttributes, SealError, Unsealed}; |
13 | 13 |
|
14 | 14 | // FIXME: Remove this (only used for debugging) |
15 | 15 | #[derive(Debug)] |
@@ -61,25 +61,13 @@ impl SealedTableEntry { |
61 | 61 | spec: UnsealSpec<'_>, |
62 | 62 | cipher: &Encryption<impl Credentials<Token = ServiceToken>>, |
63 | 63 | ) -> Result<Vec<Unsealed>, SealError> { |
64 | | - //let items = items.as_ref(); |
65 | 64 |
|
66 | 65 | let UnsealSpec { |
67 | 66 | protected_attributes, |
| 67 | + // TODO: Why is this here? |
68 | 68 | plaintext_attributes, |
69 | 69 | } = spec; |
70 | 70 |
|
71 | | - |
72 | | - // FIXME: The following issues remain: |
73 | | - // 1. The pk and sk are not being added to the unsealed |
74 | | - // 2. We don't handle the case where protected_attributes is empty |
75 | | - // 3. We don't handle the case where plaintext_attributes is empty |
76 | | - // 4. The zipped iterator is misaligned |
77 | | - // Unsealed item: Unsealed { descriptor: None, protected: {"name": (SmallInt(Some(42)), "/name"), "age": (Utf8Str(Some("value-a")), "/age"), "attrs": (Utf8Str(Some("value-c")), "/attrs")}, unprotected: TableAttributes({"tag": String("sk")}) } |
78 | | - // 5. (Minor) The Unsealed is not given a descriptor after decryption |
79 | | - // 6. Ciphertexts are unexpectedly large |
80 | | - // 7. Determine if pk and sk should be underscored (check the bahaviour in main or tests) |
81 | | - |
82 | | - //let mut plaintext_items: Vec<Vec<Option<&TableAttribute>>> = |
83 | 71 | let mut unprotected_items = Vec::with_capacity(items.len()); |
84 | 72 | let mut protected_items = FlattenedEncryptedAttributes::with_capacity(items.len() * protected_attributes.len()); |
85 | 73 |
|
|
0 commit comments