@@ -364,10 +364,10 @@ def parse_secret_option(secret) -> 'Secret':
364364 secret_class = Secret
365365 secret_params = None
366366 if secret_type == 'gcpsecret' :
367- secret_class = GcpSecret # type: ignore[assignment]
367+ secret_class = GcpSecret # type: ignore[assignment]
368368 secret_params = ['version_name' ]
369369 elif secret_type == 'gcphsmgeneratedsecret' :
370- secret_class = GcpHsmGeneratedSecret # type: ignore[assignment]
370+ secret_class = GcpHsmGeneratedSecret # type: ignore[assignment]
371371 secret_params = [
372372 'project_id' , 'location_id' , 'key_ring_id' , 'key_id' , 'job_name'
373373 ]
@@ -456,8 +456,8 @@ def get_secret_bytes(self) -> bytes:
456456 The secret as a byte string.
457457 """
458458 try :
459- from google .cloud import secretmanager
460459 from google .api_core import exceptions as api_exceptions
460+ from google .cloud import secretmanager
461461 client = secretmanager .SecretManagerServiceClient ()
462462
463463 project_path = f"projects/{ self ._project_id } "
@@ -533,8 +533,9 @@ def generate_dek(self, dek_size: int = 32) -> bytes:
533533 try :
534534 import base64
535535 import os
536- from cryptography . hazmat . primitives . kdf . hkdf import HKDF
536+
537537 from cryptography .hazmat .primitives import hashes
538+ from cryptography .hazmat .primitives .kdf .hkdf import HKDF
538539 from google .cloud import kms
539540
540541 # 1. Generate a random nonce (nonce_one)
0 commit comments