@@ -103,29 +103,33 @@ mod tests {
103
103
let plaintext = get_plaintext ( ) ;
104
104
let metadata = get_metadata ( ) ;
105
105
let documents: PlaintextAttachedDocuments =
106
- [ ( DocumentId ( "doc" . to_string ( ) ) , plaintext) ] . into ( ) ;
106
+ PlaintextAttachedDocuments ( [ ( DocumentId ( "doc" . to_string ( ) ) , plaintext) ] . into ( ) ) ;
107
107
let encrypted = get_client ( )
108
108
. standard_attached ( )
109
109
. encrypt_batch ( documents, & metadata)
110
110
. await ?;
111
- assert_eq ! ( encrypted. successes. len( ) , 1 ) ;
111
+ assert_eq ! ( encrypted. successes. 0 . len( ) , 1 ) ;
112
112
assert_eq ! ( encrypted. failures. len( ) , 0 ) ;
113
113
let bad_document =
114
114
EncryptedAttachedDocument ( EncryptedBytes ( vec ! [ 0 , 0 , 1 , 255 , 2 , 0 , 0 , 2 , 10 , 36 ] ) ) ;
115
- let new_encrypted: EncryptedAttachedDocuments = encrypted
116
- . successes
117
- . into_iter ( )
118
- . chain ( [ ( DocumentId ( "bad_doc" . to_string ( ) ) , bad_document) ] )
119
- . collect ( ) ;
115
+ let new_encrypted: EncryptedAttachedDocuments = EncryptedAttachedDocuments (
116
+ encrypted
117
+ . successes
118
+ . 0
119
+ . into_iter ( )
120
+ . chain ( [ ( DocumentId ( "bad_doc" . to_string ( ) ) , bad_document) ] )
121
+ . collect ( ) ,
122
+ ) ;
120
123
let decrypted = get_client ( )
121
124
. standard_attached ( )
122
125
. decrypt_batch ( new_encrypted, & metadata)
123
126
. await ?;
124
- assert_eq ! ( decrypted. successes. len( ) , 1 ) ;
127
+ assert_eq ! ( decrypted. successes. 0 . len( ) , 1 ) ;
125
128
assert_eq ! ( decrypted. failures. len( ) , 1 ) ;
126
129
assert_eq ! (
127
130
decrypted
128
131
. successes
132
+ . 0
129
133
. get( & DocumentId ( "doc" . to_string( ) ) )
130
134
. unwrap( ) ,
131
135
& get_plaintext( )
@@ -212,7 +216,7 @@ mod tests {
212
216
async fn standard_attached_rekey_v5_edek_works ( ) -> TestResult {
213
217
let metadata = get_metadata ( ) ;
214
218
let doc = get_ciphertext ( ) ;
215
- let docs = [ ( DocumentId ( "doc" . to_string ( ) ) , doc) ] . into ( ) ;
219
+ let docs = EncryptedAttachedDocuments ( [ ( DocumentId ( "doc" . to_string ( ) ) , doc) ] . into ( ) ) ;
216
220
let mut all_rekeyed = get_client ( )
217
221
. standard_attached ( )
218
222
. rekey_documents ( docs, & metadata, None )
@@ -243,7 +247,7 @@ mod tests {
243
247
async fn standard_attached_rekey_new_tenant_edek_works ( ) -> TestResult {
244
248
let metadata = get_metadata ( ) ;
245
249
let doc = get_ciphertext ( ) ;
246
- let docs = [ ( DocumentId ( "doc" . to_string ( ) ) , doc) ] . into ( ) ;
250
+ let docs = EncryptedAttachedDocuments ( [ ( DocumentId ( "doc" . to_string ( ) ) , doc) ] . into ( ) ) ;
247
251
let new_tenant = TenantId ( "tenant-aws" . to_string ( ) ) ;
248
252
let mut all_rekeyed = get_client ( )
249
253
. standard_attached ( )
0 commit comments