@@ -121,11 +121,7 @@ struct PushFramesResult {
121121#[ derive( Debug , Clone ) ]
122122pub struct EncryptionContext {
123123 /// 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 ,
129125}
130126
131127pub struct SyncContext {
@@ -318,13 +314,10 @@ impl SyncContext {
318314 }
319315
320316 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+ ) ;
328321 }
329322
330323 let req = req. body ( body. clone ( ) . into ( ) ) . expect ( "valid body" ) ;
@@ -439,13 +432,10 @@ impl SyncContext {
439432 }
440433
441434 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+ ) ;
449439 }
450440
451441 let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
@@ -612,13 +602,10 @@ impl SyncContext {
612602 }
613603
614604 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+ ) ;
622609 }
623610
624611 let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
@@ -718,13 +705,10 @@ impl SyncContext {
718705 }
719706
720707 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+ ) ;
728712 }
729713
730714 let req = req. body ( Body :: empty ( ) ) . expect ( "valid request" ) ;
0 commit comments