|
27 | 27 | EDA_SERVER_VAULT_LABEL,
|
28 | 28 | SOURCE_MAPPING_ERROR_KEY,
|
29 | 29 | )
|
30 |
| -from aap_eda.api.exceptions import InvalidEventStreamSource |
| 30 | +from aap_eda.api.exceptions import ExternalSMSError, InvalidEventStreamSource |
31 | 31 | from aap_eda.api.serializers.decision_environment import (
|
32 | 32 | DecisionEnvironmentRefSerializer,
|
33 | 33 | )
|
|
46 | 46 | from aap_eda.api.vault import encrypt_string
|
47 | 47 | from aap_eda.core import models, validators
|
48 | 48 | from aap_eda.core.enums import DefaultCredentialType, ProcessParentType
|
49 |
| -from aap_eda.core.exceptions import ParseError |
50 |
| -from aap_eda.core.utils.credentials import get_secret_fields |
| 49 | +from aap_eda.core.exceptions import CredentialPluginError, ParseError |
| 50 | +from aap_eda.core.utils.credentials import ( |
| 51 | + get_resolved_secrets, |
| 52 | + get_secret_fields, |
| 53 | +) |
51 | 54 | from aap_eda.core.utils.k8s_service_name import create_k8s_service_name
|
52 | 55 | from aap_eda.core.utils.rulebook import (
|
53 | 56 | build_source_list,
|
@@ -147,8 +150,10 @@ def _update_extra_vars_from_eda_credentials(
|
147 | 150 | schema_inputs = eda_credential.credential_type.inputs
|
148 | 151 | injectors = eda_credential.credential_type.injectors
|
149 | 152 | secret_fields = get_secret_fields(schema_inputs)
|
150 |
| - |
151 |
| - user_inputs = yaml.safe_load(eda_credential.inputs.get_secret_value()) |
| 153 | + try: |
| 154 | + user_inputs = get_resolved_secrets(eda_credential) |
| 155 | + except CredentialPluginError as err: |
| 156 | + raise ExternalSMSError(str(err)) |
152 | 157 |
|
153 | 158 | if creating and any(key in user_inputs for key in secret_fields):
|
154 | 159 | vault_data.password_used = True
|
|
0 commit comments