Unverified Commit 5a2aa830 authored by takatost's avatar takatost Committed by GitHub

fix: ciphertext error (#1872)

parent 4de27d04
...@@ -6,8 +6,6 @@ import json ...@@ -6,8 +6,6 @@ import json
from typing import Optional, Generator, Union, List, cast from typing import Optional, Generator, Union, List, cast
from sympy import comp
from core.model_runtime.entities.common_entities import I18nObject from core.model_runtime.entities.common_entities import I18nObject
from core.model_runtime.utils import helper from core.model_runtime.utils import helper
......
...@@ -452,11 +452,14 @@ class ProviderManager: ...@@ -452,11 +452,14 @@ class ProviderManager:
for variable in provider_credential_secret_variables: for variable in provider_credential_secret_variables:
if variable in provider_credentials: if variable in provider_credentials:
provider_credentials[variable] = encrypter.decrypt_token_with_decoding( try:
provider_credentials.get(variable), provider_credentials[variable] = encrypter.decrypt_token_with_decoding(
decoding_rsa_key, provider_credentials.get(variable),
decoding_cipher_rsa decoding_rsa_key,
) decoding_cipher_rsa
)
except ValueError:
pass
custom_provider_configuration = CustomProviderConfiguration( custom_provider_configuration = CustomProviderConfiguration(
credentials=provider_credentials credentials=provider_credentials
...@@ -481,11 +484,14 @@ class ProviderManager: ...@@ -481,11 +484,14 @@ class ProviderManager:
for variable in model_credential_secret_variables: for variable in model_credential_secret_variables:
if variable in provider_model_credentials: if variable in provider_model_credentials:
provider_model_credentials[variable] = encrypter.decrypt_token_with_decoding( try:
provider_model_credentials.get(variable), provider_model_credentials[variable] = encrypter.decrypt_token_with_decoding(
decoding_rsa_key, provider_model_credentials.get(variable),
decoding_cipher_rsa decoding_rsa_key,
) decoding_cipher_rsa
)
except ValueError:
pass
custom_model_configurations.append( custom_model_configurations.append(
CustomModelConfiguration( CustomModelConfiguration(
...@@ -577,11 +583,14 @@ class ProviderManager: ...@@ -577,11 +583,14 @@ class ProviderManager:
for variable in provider_credential_secret_variables: for variable in provider_credential_secret_variables:
if variable in provider_credentials: if variable in provider_credentials:
provider_credentials[variable] = encrypter.decrypt_token_with_decoding( try:
provider_credentials.get(variable), provider_credentials[variable] = encrypter.decrypt_token_with_decoding(
decoding_rsa_key, provider_credentials.get(variable),
decoding_cipher_rsa decoding_rsa_key,
) decoding_cipher_rsa
)
except ValueError:
pass
current_using_credentials = provider_credentials current_using_credentials = provider_credentials
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment