Skip to content

Commit f3b9c5b

Browse files
authored
JIRA WDT-426 Use "weblogic" and "password1" as placeholders for target option(#664)
1 parent 4bc8b52 commit f3b9c5b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

core/src/main/python/prepare_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
from wlsdeploy.util.model_translator import FileToPython
5151
from wlsdeploy.util.target_configuration import CONFIG_OVERRIDES_SECRETS_METHOD
5252
from wlsdeploy.util.target_configuration import SECRETS_METHOD
53+
from wlsdeploy.util.target_configuration_helper import ADMINUSER_PLACEHOLDER
5354
from wlsdeploy.util.target_configuration_helper import PASSWORD_PLACEHOLDER
5455
from wlsdeploy.util.weblogic_helper import WebLogicHelper
5556
from wlsdeploy.yaml.yaml_translator import PythonToYaml
@@ -312,7 +313,10 @@ def __substitute_password_with_token(self, model_path, attribute_name, validatio
312313
# for config override secrets, assign a placeholder password to the attribute.
313314
# config overrides will be used to override the value in the target domain.
314315
if credentials_method == CONFIG_OVERRIDES_SECRETS_METHOD:
315-
model_value = PASSWORD_PLACEHOLDER
316+
if attribute_name == ADMIN_USERNAME:
317+
model_value = ADMINUSER_PLACEHOLDER
318+
else:
319+
model_value = PASSWORD_PLACEHOLDER
316320
self.cache[cache_key] = ''
317321

318322
if model_value is not None:

core/src/main/python/wlsdeploy/tool/util/variable_injector.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from wlsdeploy.aliases import alias_constants
2121
from wlsdeploy.aliases.aliases import Aliases
2222
from wlsdeploy.aliases.location_context import LocationContext
23+
from wlsdeploy.aliases.model_constants import ADMIN_USERNAME
2324
from wlsdeploy.aliases.validation_codes import ValidationCodes
2425
from wlsdeploy.aliases.wlst_modes import WlstModes
2526
from wlsdeploy.json.json_translator import JsonToPython
@@ -401,10 +402,13 @@ def _process_attribute(self, model, attribute, location, injector_values):
401402
and variable_value == alias_constants.PASSWORD_TOKEN:
402403
model[attribute] = target_configuration_helper.format_as_secret_token(variable_name)
403404

404-
# for config_override_secrets, assign a placeholder password to the attribute
405+
# for config_override_secrets, assign a placeholder value to the attribute
405406
elif credentials_method == CONFIG_OVERRIDES_SECRETS_METHOD \
406407
and variable_value == alias_constants.PASSWORD_TOKEN:
407-
model[attribute] = target_configuration_helper.PASSWORD_PLACEHOLDER
408+
if attribute == ADMIN_USERNAME:
409+
model[attribute] = target_configuration_helper.ADMINUSER_PLACEHOLDER
410+
else:
411+
model[attribute] = target_configuration_helper.PASSWORD_PLACEHOLDER
408412

409413
else:
410414
model[attribute] = _format_as_property(variable_name)

core/src/main/python/wlsdeploy/util/target_configuration_helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
USER_TAG = "<user>"
3838
PASSWORD_TAG = "<password>"
3939

40-
# password placeholder for config override secrets
41-
PASSWORD_PLACEHOLDER = "password"
40+
# placeholders for config override secrets
41+
ADMINUSER_PLACEHOLDER = "weblogic"
42+
PASSWORD_PLACEHOLDER = "password1"
4243

4344
_jdbc_pattern = re.compile("^JDBC\\.([ \\w.-]+)\\.PasswordEncrypted$")
4445

0 commit comments

Comments
 (0)