11from __future__ import annotations
22
3+ import base64
34import logging
45import re
56from collections import defaultdict
@@ -344,7 +345,7 @@ def fulfill_cross_region_export_request(
344345 requesting_region_name : str ,
345346 replying_region_name : str ,
346347 org_slug : str ,
347- encrypt_with_public_key : bytes ,
348+ encrypt_with_public_key : str ,
348349 # Unix timestamp, in seconds.
349350 scheduled_at : int ,
350351) -> None :
@@ -357,14 +358,15 @@ def fulfill_cross_region_export_request(
357358 call is received with the encrypted export in tow, it will trigger the next step in the
358359 `SAAS_TO_SAAS` relocation's pipeline, namely `uploading_complete`.
359360 """
361+ encrypt_with_public_key_bytes = base64 .b64decode (encrypt_with_public_key .encode ("utf8" ))
360362
361363 logger_data = {
362364 "uuid" : uuid_str ,
363365 "task" : "fulfill_cross_region_export_request" ,
364366 "requesting_region_name" : requesting_region_name ,
365367 "replying_region_name" : replying_region_name ,
366368 "org_slug" : org_slug ,
367- "encrypted_public_key_size" : len (encrypt_with_public_key ),
369+ "encrypted_public_key_size" : len (encrypt_with_public_key_bytes ),
368370 "scheduled_at" : scheduled_at ,
369371 }
370372 logger .info (
@@ -396,7 +398,7 @@ def fulfill_cross_region_export_request(
396398
397399 export_in_organization_scope (
398400 fp ,
399- encryptor = LocalFileEncryptor (BytesIO (encrypt_with_public_key )),
401+ encryptor = LocalFileEncryptor (BytesIO (encrypt_with_public_key_bytes )),
400402 org_filter = {org_slug },
401403 printer = LoggingPrinter (uuid_str ),
402404 checkpointer = StorageBackedCheckpointExporter (
0 commit comments