Skip to content

Commit 91935f9

Browse files
committed
Merge branch 'alias-test-verify-fixes' into 'main'
Changes to verify null secure values, and use them in discover processing See merge request weblogic-cloud/weblogic-deploy-tooling!1811
2 parents 1ee961e + 5dffc06 commit 91935f9

File tree

13 files changed

+71
-110
lines changed

13 files changed

+71
-110
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2023, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
These constants are internal to the aliases module and should not be used, as they are not part of the public API.
@@ -31,6 +31,7 @@
3131
SECRET_KEY = 'secret_key'
3232
SECRET_SUFFIX = 'secret_suffix'
3333
SECURE_DEFAULT = 'secure_default'
34+
SECURE_DEFAULT_NULL = 'secure_default_null'
3435
SET_MBEAN_TYPE = 'set_mbean_type'
3536
SET_METHOD = 'set_method'
3637
SHORT_NAME = 'short_name'

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from wlsdeploy.aliases.alias_constants import SECRET_SUFFIX
4444
from wlsdeploy.aliases.alias_constants import SECRET_USERNAME_KEY
4545
from wlsdeploy.aliases.alias_constants import SECURE_DEFAULT
46+
from wlsdeploy.aliases.alias_constants import SECURE_DEFAULT_NULL
4647
from wlsdeploy.aliases.alias_constants import SET_MBEAN_TYPE
4748
from wlsdeploy.aliases.alias_constants import SET_METHOD
4849
from wlsdeploy.aliases.alias_constants import STRING
@@ -1402,8 +1403,8 @@ def _get_default_value_for_execution_mode(self, attribute_info):
14021403
:return: the correct default value for the execution mode
14031404
"""
14041405
if self._secure_mode_enabled:
1405-
default_value = dictionary_utils.get_element(attribute_info, SECURE_DEFAULT)
1406-
if default_value is not None:
1406+
if self._has_secure_default(attribute_info):
1407+
default_value = dictionary_utils.get_element(attribute_info, SECURE_DEFAULT)
14071408
return default_value
14081409
if self._production_mode_enabled:
14091410
default_value = dictionary_utils.get_element(attribute_info, PRODUCTION_DEFAULT)
@@ -1495,6 +1496,16 @@ def get_production_default(self, location, model_attribute):
14951496
result = attribute_info[PRODUCTION_DEFAULT]
14961497
return result
14971498

1499+
def has_secure_default(self, location, model_attribute):
1500+
attribute_info = self._alias_entries.get_alias_attribute_entry_by_model_name(location, model_attribute)
1501+
return attribute_info is not None and self._has_secure_default(attribute_info)
1502+
1503+
def _has_secure_default(self, attribute_info):
1504+
secure_default = dictionary_utils.get_element(attribute_info, SECURE_DEFAULT)
1505+
is_null = dictionary_utils.get_element(attribute_info, SECURE_DEFAULT_NULL)
1506+
is_null = alias_utils.convert_boolean(is_null)
1507+
return is_null or secure_default is not None
1508+
14981509
def get_secure_default(self, location, model_attribute):
14991510
result = None
15001511
attribute_info = self._alias_entries.get_alias_attribute_entry_by_model_name(location, model_attribute)

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/CoherenceClusterSystemResource.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"attributes": {
121121
"CoherenceClientAuth": [ {"version": "[14.1.2,)", "wlst_mode": "both", "wlst_name": "CoherenceClientAuth", "wlst_path": "WP001", "default_value": null, "wlst_type": "string"} ],
122122
"CoherenceIdentityAlias": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "CoherenceIdentityAlias", "wlst_path": "WP001", "default_value": null, "wlst_type": "string"} ],
123+
"CoherenceKeyRefreshPeriod": [ {"version": "[15.1.0.0,)", "wlst_mode": "both", "wlst_name": "CoherenceKeyRefreshPeriod", "wlst_path": "WP001", "default_value": null, "wlst_type": "string"} ],
123124
"CoherencePrivateKeyPassPhraseEncrypted": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "CoherencePrivateKeyPassPhraseEncrypted", "wlst_path": "WP001", "default_value": null, "wlst_type": "password", "get_method": "GET"} ]
124125
},
125126
"wlst_attributes_path": "WP001",
@@ -199,7 +200,7 @@
199200
{"version": "[14.1.2,)", "wlst_mode": "online", "wlst_name": "Transport", "wlst_path": "WP001", "default_value": "tmb", "wlst_type": "string", "derived_default": "${:true}" }
200201
],
201202
"UnicastListenAddress": [ {"version": "[12.1.2,12.2.1)", "wlst_mode": "both", "wlst_name": "UnicastListenAddress", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ,
202-
{"version": "[12.2.1,)", "wlst_mode": "offline", "wlst_name": "UnicastListenAddress", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
203+
{"version": "[12.2.1,15.1.1)", "wlst_mode": "offline", "wlst_name": "UnicastListenAddress", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
203204
"UnicastListenPort": [
204205
{"version": "[12.1.2,12.2.1)", "wlst_mode": "both", "wlst_name": "UnicastListenPort", "wlst_path": "WP001", "default_value": "${8088:0}", "wlst_type": "integer", "get_method": "LSA"} ,
205206
{"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "UnicastListenPort", "wlst_path": "WP001", "default_value": "${__NULL__:0}", "wlst_type": "integer", "get_method": "LSA"}

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/JMSSystemResource.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
"ForwardDelay": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ForwardDelay", "wlst_path": "WP001", "default_value": "${0:-1}", "wlst_type": "integer" } ],
176176
"JNDIName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
177177
"LoadBalancingPolicy": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LoadBalancingPolicy", "wlst_path": "WP001", "default_value": "${__NULL__:Round-Robin}", "wlst_type": "string" } ],
178-
"LocalJNDIName": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "LocalJNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
178+
"LocalJNDIName": [ {"version": "[10,15.1.1)", "wlst_mode": "offline", "wlst_name": "LocalJNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
179179
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
180180
"ResetDeliveryCountOnForward": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ResetDeliveryCountOnForward", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean" } ],
181181
"SafExportPolicy": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "${Saf:SAF}ExportPolicy", "wlst_path": "WP001", "default_value": "All", "wlst_type": "string", "get_method": "LSA", "restart_required": "true"} ],
@@ -211,7 +211,7 @@
211211
"attributes": {
212212
"JNDIName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
213213
"LoadBalancingPolicy": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LoadBalancingPolicy", "wlst_path": "WP001", "default_value": "${__NULL__:Round-Robin}", "wlst_type": "string" } ],
214-
"LocalJNDIName": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "LocalJNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
214+
"LocalJNDIName": [ {"version": "[10,15.1.1)", "wlst_mode": "offline", "wlst_name": "LocalJNDIName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "LSA"} ],
215215
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
216216
"SafExportPolicy": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "${Saf:SAF}ExportPolicy", "wlst_path": "WP001", "default_value": "All", "wlst_type": "string", "get_method": "LSA", "restart_required": "true"} ],
217217
"UnitOfOrderRouting": [ {"version": "[10,12.2.1.2)", "wlst_mode": "both", "wlst_name": "UnitOfOrderRouting", "wlst_path": "WP001", "default_value": "Hash", "wlst_type": "string", "get_method": "LSA", "restart_required": "true"} ,

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/SNMPAgent.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@
8888
"child_folders_type": "multiple",
8989
"folders": {},
9090
"attributes": {
91-
"Community": [
92-
{ "version": "[10,14.1.2)", "wlst_mode": "both", "wlst_name": "Community", "wlst_path": "WP001", "default_value": "public", "wlst_type": "string" },
93-
{ "version": "[14.1.2,)", "wlst_mode": "both", "wlst_name": "Community", "wlst_path": "WP001", "default_value": "public", "wlst_type": "string", "derived_default": "${true:}", "comment": "secure_default is null" }
94-
],
91+
"Community": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Community", "wlst_path": "WP001", "default_value": "public", "wlst_type": "string", "secure_default_null": true } ],
9592
"ListenAddress": [ { "version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "ListenAddress", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
9693
"Notes": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
9794
"OidRoot": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "OidRoot", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
@@ -135,7 +132,7 @@
135132
"child_folders_type": "multiple",
136133
"folders": {},
137134
"attributes": {
138-
"Community": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Community", "wlst_path": "WP001", "default_value": "public", "wlst_type": "string" } ],
135+
"Community": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Community", "wlst_path": "WP001", "default_value": "public", "wlst_type": "string", "secure_default_null": true } ],
139136
"Host": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Host", "wlst_path": "WP001", "default_value": "localhost", "wlst_type": "string" } ],
140137
"Notes": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
141138
"Port": [ { "version": "[10,)", "wlst_mode": "both", "wlst_name": "Port", "wlst_path": "WP001", "default_value": 162, "wlst_type": "integer" } ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/SecurityConfiguration.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,10 @@
19461946
"EnforceValidBasicAuthCredentials": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EnforceValidBasicAuthCredentials", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean", "restart_required": "true" } ],
19471947
"ExcludedDomainName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ExcludedDomainName${:s}", "wlst_path": "WP001", "default_value": null, "wlst_type": "delimited_string" } ],
19481948
"IdentityDomainAwareProvidersRequired": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "IdentityDomainAwareProvidersRequired", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
1949-
"IdentityDomainDefaultEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "IdentityDomainDefaultEnabled", "wlst_path": "WP001", "default_value": "${false:true}", "wlst_type": "boolean", "get_method": "${LSA:GET}" } ],
1949+
"IdentityDomainDefaultEnabled": [
1950+
{"version": "[12.2.1,15.1.1)", "wlst_mode": "both", "wlst_name": "IdentityDomainDefaultEnabled", "wlst_path": "WP001", "default_value": "${false:true}", "wlst_type": "boolean", "get_method": "${LSA:GET}" },
1951+
{"version": "[15.1.1,)", "wlst_mode": "both", "wlst_name": "IdentityDomainDefaultEnabled", "wlst_path": "WP001", "default_value": true, "wlst_type": "boolean", "get_method": "${LSA:GET}" }
1952+
],
19501953
"NodeManagerPasswordEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "NodeManagerPasswordEncrypted", "wlst_path": "WP001", "default_value": null, "wlst_type": "password", "get_method": "GET", "secret_suffix": "nodemanager" } ],
19511954
"NodeManagerUsername": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "NodeManagerUsername", "wlst_path": "WP001", "default_value": "weblogic", "wlst_type": "credential", "secret_suffix": "nodemanager" } ],
19521955
"NonceTimeoutSeconds": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "NonceTimeoutSeconds", "wlst_path": "WP001", "default_value": 120, "wlst_type": "integer" } ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@
19641964
"DefaultProtocol": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultProtocol", "wlst_path": "WP001", "default_value": "${__NULL__:t3}", "wlst_type": "string" } ],
19651965
"DefaultSecureProtocol": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultSecureProtocol", "wlst_path": "WP001", "default_value": "${__NULL__:t3s}", "wlst_type": "string" } ],
19661966
"DefaultTGIOPPasswordEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultTGIOPPasswordEncrypted", "wlst_path": "WP001", "default_value": null, "wlst_type": "password", "get_method": "GET", "secret_suffix": "tgiop" } ],
1967-
"DefaultTGIOPUser": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultTGIOPUser", "wlst_path": "WP001", "default_value": "guest", "wlst_type": "string" } ],
1967+
"DefaultTGIOPUser": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultTGIOPUser", "wlst_path": "WP001", "default_value": "guest", "secure_default_null": true, "wlst_type": "string" } ],
19681968
"DevPollDisabled": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "DevPollDisabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "LSA"} ],
19691969
"EagerThreadLocalCleanup": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "EagerThreadLocalCleanup", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "LSA", "restart_required": "true"} ],
19701970
"ExpectedToRun": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "ExpectedToRun", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean", "get_method": "GET"} ],

0 commit comments

Comments
 (0)