Skip to content

Commit f0df27b

Browse files
committed
Issue #484 - Use of model encryption with online update fails
1 parent e53e7d7 commit f0df27b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

core/src/main/python/wlsdeploy/aliases/aliases.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,7 @@ def get_wlst_attribute_name_and_value(self, location, model_attribute_name, mode
397397
attribute_info = module_folder[ATTRIBUTES][model_attribute_name]
398398

399399
if attribute_info and not self.__is_model_attribute_read_only(location, attribute_info):
400-
password_attribute_name = \
401-
password_utils.get_wlst_attribute_name(attribute_info, model_attribute_value, self._wlst_mode)
402-
403-
if password_attribute_name is not None:
404-
wlst_attribute_name = password_attribute_name
405-
else:
406-
wlst_attribute_name = attribute_info[WLST_NAME]
400+
wlst_attribute_name = attribute_info[WLST_NAME]
407401

408402
if self._model_context and USES_PATH_TOKENS in attribute_info and \
409403
string_utils.to_boolean(attribute_info[USES_PATH_TOKENS]):
@@ -413,6 +407,14 @@ def get_wlst_attribute_name_and_value(self, location, model_attribute_name, mode
413407
if data_type == 'password':
414408
try:
415409
wlst_attribute_value = self.decrypt_password(model_attribute_value)
410+
411+
# the attribute name may change for special cases, check against decrypted value
412+
password_attribute_name = \
413+
password_utils.get_wlst_attribute_name(attribute_info, wlst_attribute_value, self._wlst_mode)
414+
415+
if password_attribute_name is not None:
416+
wlst_attribute_name = password_attribute_name
417+
416418
except EncryptionException, ee:
417419
ex = exception_helper.create_alias_exception('WLSDPLY-08402', model_attribute_name,
418420
location.get_folder_path(),
@@ -1200,7 +1202,7 @@ def get_wlst_read_type(self, location, model_attribute_name):
12001202

12011203
def decrypt_password(self, text):
12021204
"""
1203-
Encrypt the specified password if encryption is used and the password is encrypted.
1205+
Decrypt the specified password if model encryption is used and the password is encrypted.
12041206
:param text: the text to check and decrypt, if needed
12051207
:return: the clear text
12061208
:raises EncryptionException: if an error occurs while decrypting the password

site/encrypt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Models contain WebLogic Server domain configuration. Certain types of resources and other configurations require passwords; for example, a JDBC data source requires the password for the user establishing the database connection. When creating or configuring a resource that requires a password, that password must be specified either in the model directly or in the variable file. Clear-text passwords are not conducive to storing configurations as source, so the Encrypt Model Tool gives the model author the ability to encrypt the passwords in the model and variable file using passphrase-based, reversible encryption. When using a tool with a model containing encrypted passwords, the encryption passphrase must be provided, so that the tool can decrypt the password in memory to set the necessary WebLogic Server configuration (which supports its own encryption mechanism based on a domain-specific key). While there is no requirement to use the Oracle WebLogic Server Deploy Tooling encryption mechanism, it is highly recommended because storing clear text passwords on disk is never a good idea.
66

7+
**NOTE: WebLogic Server Deploy Tooling also supports the use of domain-encrypted passwords directly in the model. The Encrypt Model Tool should not be used in tandem with this method.**
8+
79
Start with the following example model:
810

911
```yaml

0 commit comments

Comments
 (0)