Skip to content

Commit 47bfd07

Browse files
TheFrogPadddsharpe
authored andcommitted
Add support for Embedded LDAP server configuration in the model topology section (#438)
* Add the EmbbeddedLDAPMBean alias definition * Enable use of EmbbeddedLDAP in the topology section * Add support for EmbeddedLDAP model discovery
1 parent f069a2e commit 47bfd07

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class AliasEntries(object):
7777
'Cluster': 'Cluster',
7878
'CoherenceClusterSystemResource': 'CoherenceClusterSystemResource',
7979
'Domain': 'Domain',
80+
'EmbeddedLDAP': 'EmbeddedLDAP',
8081
'FileStore': 'FileStore',
8182
'ForeignJNDIProvider': 'ForeignJNDIProvider',
8283
'JDBCStore': 'JDBCStore',
@@ -124,6 +125,7 @@ class AliasEntries(object):
124125
__topology_top_level_folders = [
125126
'AdminConsole',
126127
'Cluster',
128+
'EmbeddedLDAP',
127129
'JMX',
128130
'JTA',
129131
'Log',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
CPU_UTILIZATION = 'CpuUtilization'
7070
CREATE_TABLE_DDL_FILE = 'CreateTableDDLFile'
7171
CREDENTIAL = 'Credential'
72+
CREDENTIAL_ENCRYPTED = 'CredentialEncrypted'
7273
CREDENTIAL_MAPPER = 'CredentialMapper'
7374
CUSTOM_DBMS_AUTHENTICATOR = 'CustomDBMSAuthenticator'
7475
DATA_SOURCE = 'DataSource'
@@ -94,6 +95,7 @@
9495
DOMAIN_INFO = 'domainInfo'
9596
DOMAIN_LIBRARIES = 'domainLibraries'
9697
DYNAMIC_SERVERS = 'DynamicServers'
98+
EMBEDDED_LDAP = 'EmbeddedLDAP'
9799
ERROR_DESTINATION = 'ErrorDestination'
98100
EXECUTE_QUEUE = 'ExecuteQueue'
99101
EXPRESSION = 'Expression'

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def discover(self):
8282
model_top_folder_name, security_configuration = self.discover_security_configuration()
8383
discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, security_configuration)
8484

85+
model_top_folder_name, embedded_ldap_configuration = self.get_embedded_ldap_configuration()
86+
discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, embedded_ldap_configuration)
87+
8588
_logger.exiting(class_name=_class_name, method_name=_method_name)
8689
return self._dictionary
8790

@@ -304,6 +307,31 @@ def discover_security_configuration(self):
304307
_logger.exiting(class_name=_class_name, method_name=_method_name)
305308
return model_top_folder_name, result
306309

310+
def get_embedded_ldap_configuration(self):
311+
"""
312+
Get the Embedded LDAP server configuration for the domain and only return the configuration
313+
when there are non-default settings other than the credential value.
314+
:return: name for the model:dictionary containing the discovered Embedded LDAP configuration
315+
"""
316+
_method_name = 'get_embedded_ldap_configuration'
317+
_logger.entering(class_name=_class_name, method_name=_method_name)
318+
result = OrderedDict()
319+
model_top_folder_name = model_constants.EMBEDDED_LDAP
320+
location = LocationContext(self._base_location)
321+
location.append_location(model_top_folder_name)
322+
embedded_ldap_configuration = self._find_singleton_name_in_folder(location)
323+
if embedded_ldap_configuration is not None:
324+
location.add_name_token(self._alias_helper.get_name_token(location), embedded_ldap_configuration)
325+
self._populate_model_parameters(result, location)
326+
# IFF credential is the only attribute, skip adding the Embedded LDAP server configuration
327+
if len(result) == 1 and model_constants.CREDENTIAL_ENCRYPTED in result:
328+
result = OrderedDict()
329+
_logger.info('WLSDPLY-06639', class_name=_class_name, method_name=_method_name)
330+
else:
331+
_logger.info('WLSDPLY-06640', class_name=_class_name, method_name=_method_name)
332+
_logger.exiting(class_name=_class_name, method_name=_method_name)
333+
return model_top_folder_name, result
334+
307335
# Private methods
308336

309337
def _get_admin_console(self):
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"copyright": "Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.",
3+
"license": "The Universal Permissive License (UPL), Version 1.0",
4+
"wlst_type": "EmbeddedLDAP",
5+
"child_folders_type": "single_unpredictable",
6+
"default_name_value": "%DOMAIN%",
7+
"folders": {},
8+
"attributes": {
9+
"AnonymousBindAllowed": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "AnonymousBindAllowed", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
10+
"BackupCopies": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "BackupCopies", "wlst_path": "WP001", "value": {"default": 7 }, "wlst_type": "integer" } ],
11+
"BackupHour": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "BackupHour", "wlst_path": "WP001", "value": {"default": 23 }, "wlst_type": "integer" } ],
12+
"BackupMinute": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "BackupMinute", "wlst_path": "WP001", "value": {"default": 5 }, "wlst_type": "integer" } ],
13+
"CacheEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CacheEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
14+
"CacheSize": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CacheSize", "wlst_path": "WP001", "value": {"default": 32 }, "wlst_type": "integer" } ],
15+
"CacheTTL": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CacheTTL", "wlst_path": "WP001", "value": {"default": 60 }, "wlst_type": "integer" } ],
16+
"CredentialEncrypted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CredentialEncrypted", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "password", "get_method": "GET" } ],
17+
"KeepAliveEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "KeepAliveEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
18+
"MasterFirst": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "MasterFirst", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
19+
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
20+
"RefreshReplicaAtStartup": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "RefreshReplicaAtStartup", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
21+
"Timeout": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Timeout", "wlst_path": "WP001", "value": {"default": 0 }, "wlst_type": "integer" } ]
22+
},
23+
"wlst_attributes_path": "WP001",
24+
"wlst_paths": {
25+
"WP001": "/EmbeddedLDAP/%EMBEDDED_LDAP%"
26+
}
27+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ WLSDPLY-06635=Adding XML Registry {0}
695695
WLSDPLY-06636=Adding keystore file {0} for node manager to archive file
696696
WLSDPLY-06637=Unable to locate and add node manager keystore file {0} to the archive file : {1}
697697
WLSDPLY-06638=Unexpected exception attempting to add node manager keystore file {0} to the archive : {1}
698+
WLSDPLY-06639=Skipping Embedded LDAP Server Configuration
699+
WLSDPLY-06640=Adding Embedded LDAP Server Configuration
698700

699701
# multi_tenant_discoverer.py, multi_tenant_resources_dsi
700702
WLSDPLY-06700=Discover Multi-tenant

0 commit comments

Comments
 (0)