fix(trigger): update client parameter handling in TriggerProviderService

- Modified the `create_provider_encrypter` call to include a cache assignment, ensuring proper management of encryption resources.
- Added a cache deletion step after updating client parameters, enhancing the integrity of the parameter handling process.

These changes improve the reliability of client parameter updates within the trigger provider service.
This commit is contained in:
Harry 2025-09-17 20:57:52 +08:00
parent 4a17025467
commit e76d80defe
1 changed files with 2 additions and 1 deletions

View File

@ -400,7 +400,7 @@ class TriggerProviderService:
# Update client params if provided
if client_params is not None:
encrypter, _ = create_provider_encrypter(
encrypter, cache = create_provider_encrypter(
tenant_id=tenant_id,
config=[x.to_basic_provider_config() for x in provider_controller.get_oauth_client_schema()],
cache=NoOpProviderCredentialCache(),
@ -413,6 +413,7 @@ class TriggerProviderService:
for key, value in client_params.items()
}
custom_client.encrypted_oauth_params = json.dumps(encrypter.encrypt(new_params))
cache.delete()
# Update enabled status if provided
if enabled is not None: