File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
airbyte_cdk/sources/declarative/auth Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -173,19 +173,19 @@ def _get_secret_key(self) -> JwtKeyTypes:
173173 secret_key : str = self ._secret_key .eval (self .config , json_loads = json .loads )
174174
175175 if self ._passphrase :
176- # Load encrypted private key and cast to JWT-compatible type
177- # The JWT algorithms we support (RSA, ECDSA, EdDSA) use compatible key types
178- private_key = serialization .load_pem_private_key (
179- secret_key .encode (),
180- password = self . _passphrase . eval ( self . config , json_loads = json . loads ) .encode (),
181- )
182- return cast (JwtKeyTypes , private_key )
183- else :
184- return (
185- base64 .b64encode (secret_key .encode ()).decode ()
186- if self ._base64_encode_secret_key
187- else secret_key
188- )
176+ passphrase_value = self . _passphrase . eval ( self . config , json_loads = json . loads )
177+ if passphrase_value :
178+ private_key = serialization .load_pem_private_key (
179+ secret_key .encode (),
180+ password = passphrase_value .encode (),
181+ )
182+ return cast (JwtKeyTypes , private_key )
183+
184+ return (
185+ base64 .b64encode (secret_key .encode ()).decode ()
186+ if self ._base64_encode_secret_key
187+ else secret_key
188+ )
189189
190190 def _get_signed_token (self ) -> Union [str , Any ]:
191191 """
You can’t perform that action at this time.
0 commit comments