Skip to content

Commit df2d794

Browse files
committed
Merge branch 'main' into WDT-539-bypass-domainBin-for-targets
2 parents db3dd1a + a0aabcb commit df2d794

File tree

6 files changed

+191
-2
lines changed

6 files changed

+191
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class AliasEntries(object):
112112
'VirtualHost',
113113
'VirtualTarget',
114114
'WSReliableDeliveryPolicy',
115+
'WebserviceSecurity',
115116
'XMLEntityCache',
116117
'XMLRegistry'
117118
]
@@ -646,13 +647,13 @@ def get_wlst_mbean_type_for_location(self, location):
646647
:raises AliasException: if an error occurs
647648
"""
648649
_method_name = 'get_wlst_mbean_type_for_location'
650+
_logger.entering(str(location), class_name=_class_name, method_name=_method_name)
649651

650652
# some callers use this method to check for location valid.
651653
# they should call is_model_location_valid(location) directly instead.
652654
if not self.is_model_location_valid(location):
653655
return None
654656

655-
_logger.entering(str(location), class_name=_class_name, method_name=_method_name)
656657
folder_dict = self.__get_dictionary_for_location(location, False)
657658
if folder_dict is None:
658659
wlst_type = None

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@
314314
WEB_SERVICE_PHYSICAL_STORE = 'WebServicePhysicalStore'
315315
WEB_SERVICE_REQUEST_BUFFERING_QUEUE = 'WebServiceRequestBufferingQueue'
316316
WEB_SERVICE_RESPONSE_BUFFERING_QUEUE = 'WebServiceResponseBufferingQueue'
317+
WEB_SERVICE_SECURITY = 'WebserviceSecurity'
317318
WEBLOGIC_CERT_PATH_PROVIDER = 'WebLogicCertPathProvider'
318319
WORK_MANAGER = "WorkManager"
319320
WLDF_INSTRUMENTATION_MONITOR = "WLDFInstrumentationMonitor"

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
7272
from wlsdeploy.aliases.model_constants import WLS_USER_PASSWORD_CREDENTIAL_MAPPINGS
7373
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
74+
from wlsdeploy.aliases.model_constants import WEB_SERVICE_SECURITY
7475
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
7576
from wlsdeploy.aliases.model_constants import XML_REGISTRY
7677
from wlsdeploy.exception import exception_helper
@@ -699,6 +700,9 @@ def __create_mbeans_used_by_topology_mbeans(self, topology_folder_list):
699700
self.__create_xml_registry(location)
700701
topology_folder_list.remove(XML_REGISTRY)
701702

703+
self.__create_ws_security(location)
704+
topology_folder_list.remove(WEB_SERVICE_SECURITY)
705+
702706
def __create_security_folder(self):
703707
"""
704708
Create the the security objects if any. The security information
@@ -777,6 +781,20 @@ def __create_xml_registry(self, location):
777781
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
778782
return
779783

784+
def __create_ws_security(self, location):
785+
"""
786+
Create the WebserviceSecurity objects, if any.
787+
:param location: the current location
788+
"""
789+
_method_name = '__create_ws_security'
790+
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
791+
ws_security = dictionary_utils.get_dictionary_element(self._topology, WEB_SERVICE_SECURITY)
792+
793+
if len(ws_security) > 0:
794+
self._create_named_mbeans(WEB_SERVICE_SECURITY, ws_security, location, log_created=True)
795+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
796+
return
797+
780798
def __create_machines(self, location):
781799
"""
782800
Create the /Machine and /UnixMachine folder objects, if any.

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def discover(self):
111111
model_folder_name, folder_result = self._get_xml_registries()
112112
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
113113

114+
model_folder_name, folder_result = self._get_ws_securities()
115+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
116+
114117
_logger.exiting(class_name=_class_name, method_name=_method_name)
115118
return self._dictionary
116119

@@ -549,6 +552,32 @@ def _get_xml_registries(self):
549552
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
550553
return model_top_folder_name, result
551554

555+
def _get_ws_securities(self):
556+
"""
557+
Discover the Webservice Security configuration for the domain
558+
:return: model name for the folder: dictionary containing the discovered webservice security
559+
"""
560+
_method_name = '_get_ws_securities'
561+
_logger.entering(class_name=_class_name, method_name=_method_name)
562+
model_top_folder_name = model_constants.WEB_SERVICE_SECURITY
563+
result = OrderedDict()
564+
location = LocationContext(self._base_location)
565+
location.append_location(model_top_folder_name)
566+
wssecurities = self._find_names_in_folder(location)
567+
if wssecurities is not None:
568+
_logger.info('WLSDPLY-06649', len(wssecurities), class_name=_class_name, method_name=_method_name)
569+
name_token = self._aliases.get_name_token(location)
570+
for wssecurity in wssecurities:
571+
_logger.info('WLSDPLY-06650', wssecurity, class_name=_class_name, method_name=_method_name)
572+
location.add_name_token(name_token, wssecurity)
573+
result[wssecurity] = OrderedDict()
574+
self._populate_model_parameters(result[wssecurity], location)
575+
self._discover_subfolders(result[wssecurity], location)
576+
location.remove_name_token(name_token)
577+
578+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
579+
return model_top_folder_name, result
580+
552581
def _massage_security_credential(self, result, location):
553582
_method_name = 'massage_security_credential'
554583
# Determine if the SecurityConfiguration/CredentialEncrypted can be removed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"copyright": "Copyright (c) 2022, Oracle Corporation and/or its affiliates.",
3+
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
4+
"wlst_type": "WebserviceSecurit${y:ies}",
5+
"child_folders_type": "multiple",
6+
"short_name": "WSSecurity",
7+
"folders": {
8+
"WebserviceCredentialProvider" : {
9+
"wlst_type": "WebserviceCredentialProvider${:s}",
10+
"version": "[10,)",
11+
"child_folders_type": "multiple",
12+
"folders": {
13+
"ConfigurationProperty" : {
14+
"wlst_type": "ConfigurationPropert${y:ies}",
15+
"version": "[10,)",
16+
"child_folders_type": "multiple",
17+
"folders": {},
18+
"attributes": {
19+
"EncryptValueRequired": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptValueRequired", "wlst_path": "WP001", "default_value": null, "wlst_type": "boolean" } ],
20+
"EncryptedValueEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptedValueEncrypted", "wlst_path": "WP001", "default_value": null, "wlst_type": "password", "get_method": "GET" } ],
21+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
22+
"Value": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Value", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
23+
},
24+
"wlst_attributes_path": "WP001",
25+
"wlst_paths": {
26+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceCredentialProvider${:s}/%WSCREDENTIAL%/ConfigurationPropert${y:ies}/%PROPERTY%"
27+
}
28+
}
29+
},
30+
"attributes": {
31+
"ClassName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClassName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
32+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
33+
"TokenType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "TokenType", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
34+
},
35+
"wlst_attributes_path": "WP001",
36+
"wlst_paths": {
37+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceCredentialProvider${:s}/%WSCREDENTIAL%"
38+
}
39+
},
40+
"WebserviceSecurityToken" : {
41+
"wlst_type": "WebserviceSecurityToken${:s}",
42+
"version": "[10,)",
43+
"child_folders_type": "multiple",
44+
"folders": {
45+
"ConfigurationProperty" :
46+
{
47+
"wlst_type": "ConfigurationPropert${y:ies}",
48+
"version": "[10,)",
49+
"child_folders_type": "multiple",
50+
"folders": {},
51+
"attributes": {
52+
"EncryptValueRequired": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptValueRequired", "wlst_path": "WP001", "default_value": null, "wlst_type": "boolean" } ],
53+
"EncryptedValueEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptedValueEncrypted", "wlst_path": "WP001", "default_value": false, "wlst_type": "password", "get_method": "GET" } ],
54+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
55+
"Value": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Value", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
56+
57+
},
58+
"wlst_attributes_path": "WP001",
59+
"wlst_paths": {
60+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceSecurityToken${:s}/%WSTOKEN%/ConfigurationPropert${y:ies}/%PROPERTY%"
61+
}
62+
}
63+
},
64+
"attributes": {
65+
"ClassName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClassName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
66+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
67+
"TokenType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "TokenType", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
68+
},
69+
"wlst_attributes_path": "WP001",
70+
"wlst_paths": {
71+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceSecurityToken${:s}/%WSTOKEN%"
72+
}
73+
},
74+
"WebserviceTimestamp" : {
75+
"wlst_type": "WebserviceTimestamp",
76+
"version": "[10,)",
77+
"default_name_value": "${NO_NAME_0:%WEBSERVICE%}",
78+
"folders": {},
79+
"attributes": {
80+
"ClockSkew": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClockSkew", "wlst_path": "WP001", "default_value": 60000, "wlst_type": "integer" } ],
81+
"ClockSynchronized": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClockSynchronized", "wlst_path": "WP001", "default_value": true, "wlst_type": "boolean" } ],
82+
"MaxProcessingDelay": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "MaxProcessingDelay", "wlst_path": "WP001", "default_value": -1, "wlst_type": "integer" } ],
83+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
84+
"ValidityPeriod": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ValidityPeriod", "wlst_path": "WP001", "default_value": 60, "wlst_type": "integer" } ]
85+
},
86+
"wlst_attributes_path": "WP001",
87+
"wlst_paths": {
88+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceTimestamp/%WEBSERVICETIMESTAMP%"
89+
}
90+
},
91+
"WebserviceTokenHandler" : {
92+
"wlst_type": "WebserviceTokenHandler${:s}",
93+
"version": "[10,)",
94+
"child_folders_type": "multiple",
95+
"folders": {
96+
"ConfigurationProperty" :
97+
{
98+
"wlst_type": "ConfigurationPropert${y:ies}",
99+
"version": "[10,)",
100+
"child_folders_type": "multiple",
101+
"folders": {},
102+
"attributes": {
103+
"EncryptValueRequired": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptValueRequired", "wlst_path": "WP001", "default_value": null, "wlst_type": "boolean" } ],
104+
"EncryptedValueEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "EncryptedValueEncrypted", "wlst_path": "WP001", "default_value": false, "wlst_type": "password", "get_method": "GET" } ],
105+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
106+
"Value": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Value", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
107+
108+
},
109+
"wlst_attributes_path": "WP001",
110+
"wlst_paths": {
111+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceTokenHandler${:s}/%WSTOKENHANDLER%/ConfigurationPropert${y:ies}/%PROPERTY%"
112+
}
113+
}
114+
},
115+
"attributes": {
116+
"ClassName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClassName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
117+
"HandlingOrder": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "HandlingOrder", "wlst_path": "WP001", "default_value": 0, "wlst_type": "integer" } ],
118+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
119+
"TokenType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "TokenType", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
120+
},
121+
"wlst_attributes_path": "WP001",
122+
"wlst_paths": {
123+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%/WebserviceTokenHandler${:s}/%WSTOKENHANDLER%"
124+
}
125+
}
126+
},
127+
"attributes": {
128+
"CompatibilityOrderingPreference": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CompatibilityOrderingPreference", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
129+
"CompatibilityPreference": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CompatibilityPreference", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
130+
"DefaultCredentialProviderSTSURI": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DefaultCredentialProviderSTSURI", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
131+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
132+
"PolicySelectionPreference": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PolicySelectionPreference", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
133+
},
134+
"wlst_attributes_path": "WP001",
135+
"wlst_paths": {
136+
"WP001": "/WebserviceSecurit${y:ies}/%WEBSERVICE%"
137+
}
138+
139+
}

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ WLSDPLY-06645=Machine is not present in domain. Remove SecurityConfiguration Nod
801801
WLSDPLY-06646=Machine is present in domain so will not remove SecurityConfiguration NodeManagerPasswordEncrypted default
802802
WLSDPLY-06647=Discovering {0} Virtual Hosts
803803
WLSDPLY-06648=Adding Virtual Host {0}
804-
804+
WLSDPLY-06649=Discovering {0} Web Service Securities
805+
WLSDPLY-06650=Adding Web Service Security {0}
805806

806807
# multi_tenant_discoverer.py, multi_tenant_resources_dsi
807808
WLSDPLY-06700=Discover Multi-tenant

0 commit comments

Comments
 (0)