@@ -121,11 +121,7 @@ struct PushFramesResult {
121
121
#[ derive( Debug , Clone ) ]
122
122
pub struct EncryptionContext {
123
123
/// The base64-encoded key for the encryption, sent on every request.
124
- pub key_16_bytes_base64_encoded : String ,
125
- /// Whether the pushed frames are already encrypted.
126
- pub push_is_encrypted : bool ,
127
- /// Whether to request the server to decrypt the pulled frames.
128
- pub decrypt_pull : bool ,
124
+ pub key_32_bytes_base64_encoded : String ,
129
125
}
130
126
131
127
pub struct SyncContext {
@@ -318,13 +314,10 @@ impl SyncContext {
318
314
}
319
315
320
316
if let Some ( remote_encryption) = & self . remote_encryption {
321
- if remote_encryption. decrypt_pull {
322
- req = req. header ( "x-turso-decrypt-response" , "true" ) ;
323
- }
324
- if remote_encryption. push_is_encrypted {
325
- req = req. header ( "x-turso-encrypted-request" , "true" ) ;
326
- }
327
- req = req. header ( "x-turso-encryption-key" , remote_encryption. key_16_bytes_base64_encoded . as_str ( ) ) ;
317
+ req = req. header (
318
+ "x-turso-encryption-key" ,
319
+ remote_encryption. key_32_bytes_base64_encoded . as_str ( ) ,
320
+ ) ;
328
321
}
329
322
330
323
let req = req. body ( body. clone ( ) . into ( ) ) . expect ( "valid body" ) ;
@@ -439,13 +432,10 @@ impl SyncContext {
439
432
}
440
433
441
434
if let Some ( remote_encryption) = & self . remote_encryption {
442
- if remote_encryption. decrypt_pull {
443
- req = req. header ( "x-turso-decrypt-response" , "true" ) ;
444
- }
445
- if remote_encryption. push_is_encrypted {
446
- req = req. header ( "x-turso-encrypted-request" , "true" ) ;
447
- }
448
- req = req. header ( "x-turso-encryption-key" , remote_encryption. key_16_bytes_base64_encoded . as_str ( ) ) ;
435
+ req = req. header (
436
+ "x-turso-encryption-key" ,
437
+ remote_encryption. key_32_bytes_base64_encoded . as_str ( ) ,
438
+ ) ;
449
439
}
450
440
451
441
let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
@@ -612,13 +602,10 @@ impl SyncContext {
612
602
}
613
603
614
604
if let Some ( remote_encryption) = & self . remote_encryption {
615
- if remote_encryption. decrypt_pull {
616
- req = req. header ( "x-turso-decrypt-response" , "true" ) ;
617
- }
618
- if remote_encryption. push_is_encrypted {
619
- req = req. header ( "x-turso-encrypted-request" , "true" ) ;
620
- }
621
- req = req. header ( "x-turso-encryption-key" , remote_encryption. key_16_bytes_base64_encoded . as_str ( ) ) ;
605
+ req = req. header (
606
+ "x-turso-encryption-key" ,
607
+ remote_encryption. key_32_bytes_base64_encoded . as_str ( ) ,
608
+ ) ;
622
609
}
623
610
624
611
let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
@@ -718,13 +705,10 @@ impl SyncContext {
718
705
}
719
706
720
707
if let Some ( remote_encryption) = & self . remote_encryption {
721
- if remote_encryption. decrypt_pull {
722
- req = req. header ( "x-turso-decrypt-response" , "true" ) ;
723
- }
724
- if remote_encryption. push_is_encrypted {
725
- req = req. header ( "x-turso-encrypted-request" , "true" ) ;
726
- }
727
- req = req. header ( "x-turso-encryption-key" , remote_encryption. key_16_bytes_base64_encoded . as_str ( ) ) ;
708
+ req = req. header (
709
+ "x-turso-encryption-key" ,
710
+ remote_encryption. key_32_bytes_base64_encoded . as_str ( ) ,
711
+ ) ;
728
712
}
729
713
730
714
let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
0 commit comments