4
4
"""
5
5
6
6
from wlsdeploy .aliases .location_context import LocationContext
7
- from wlsdeploy .aliases .model_constants import ACTIVE_TYPE
8
- from wlsdeploy .aliases .model_constants import ADJUDICATOR
9
- from wlsdeploy .aliases .model_constants import AUDITOR
10
- from wlsdeploy .aliases .model_constants import AUTHENTICATION_PROVIDER
11
- from wlsdeploy .aliases .model_constants import AUTHORIZER
12
- from wlsdeploy .aliases .model_constants import CERT_PATH_PROVIDER
13
- from wlsdeploy .aliases .model_constants import CREDENTIAL_MAPPER
14
- from wlsdeploy .aliases .model_constants import DEFAULT_ADJUDICATOR_NAME
15
- from wlsdeploy .aliases .model_constants import DEFAULT_ADJUDICATOR_TYPE
16
- from wlsdeploy .aliases .model_constants import DEFAULT_AUDITOR_NAME
17
- from wlsdeploy .aliases .model_constants import DEFAULT_AUDITOR_TYPE
18
- from wlsdeploy .aliases .model_constants import DEFAULT_AUTHENTICATOR_NAME
19
- from wlsdeploy .aliases .model_constants import DEFAULT_AUTHENTICATOR_TYPE
20
- from wlsdeploy .aliases .model_constants import DEFAULT_AUTHORIZER_NAME
21
- from wlsdeploy .aliases .model_constants import DEFAULT_AUTHORIZER_TYPE
22
- from wlsdeploy .aliases .model_constants import DEFAULT_CERT_PATH_PROVIDER_NAME
23
- from wlsdeploy .aliases .model_constants import DEFAULT_CERT_PATH_PROVIDER_TYPE
24
- from wlsdeploy .aliases .model_constants import DEFAULT_CREDENTIAL_MAPPER_NAME
25
- from wlsdeploy .aliases .model_constants import DEFAULT_CREDENTIAL_MAPPER_TYPE
26
- from wlsdeploy .aliases .model_constants import DEFAULT_IDENTITY_ASSERTER_NAME
27
- from wlsdeploy .aliases .model_constants import DEFAULT_IDENTITY_ASSERTER_TYPE
28
- from wlsdeploy .aliases .model_constants import DEFAULT_PASSWORD_VALIDATOR_NAME
29
- from wlsdeploy .aliases .model_constants import DEFAULT_PASSWORD_VALIDATOR_TYPE
30
- from wlsdeploy .aliases .model_constants import DEFAULT_ROLE_MAPPER_NAME
31
- from wlsdeploy .aliases .model_constants import DEFAULT_ROLE_MAPPER_TYPE
32
- from wlsdeploy .aliases .model_constants import PASSWORD_VALIDATOR
33
7
from wlsdeploy .aliases .model_constants import REALM
34
- from wlsdeploy .aliases .model_constants import ROLE_MAPPER
35
8
from wlsdeploy .aliases .model_constants import SECURITY_CONFIGURATION
36
9
from wlsdeploy .tool .create .creator import Creator
37
10
from wlsdeploy .tool .deploy import deployer_utils
38
11
from wlsdeploy .util import dictionary_utils
12
+ import oracle .weblogic .deploy .util .WebLogicDeployToolingVersion as WDTVersion
39
13
40
14
41
15
class SecurityProviderCreator (Creator ):
@@ -45,16 +19,16 @@ class SecurityProviderCreator(Creator):
45
19
46
20
This release of weblogic deploy tool handles security providers as outlined below:
47
21
48
- The update domain tool will not configure the SecurityConfiguration MBean.
22
+ The update domain tool expects the security realm providers in the model to describe all non-default values of the
23
+ existing domain realms.
49
24
50
25
Custom Security Providers are supported in 12c releases only.
51
26
27
+ Configuration of the security realms is not supported in 11g -
52
28
Default providers in 11g have no name. Offline wlst returns 'Provider' as each provider name instead.
53
29
The offline wlst will lose its way if you attempt to remove the MBean named provider, or if you rename
54
30
the provider and attempt to rename the new provider and most of the time you can add
55
31
56
- The SecurityConfiguration is added if it does not exist. The default realm is added if it does not exist.
57
-
58
32
In recap, the issues found for realms are as follows. These issues are handled in this release.
59
33
1. The weblogic template in 11g installs default security providers with no name. In offline
60
34
wlst, the names are represented as 'Provider'. There is no way to successfully fix the providers except to
@@ -65,6 +39,8 @@ class SecurityProviderCreator(Creator):
65
39
4. Offline wlst in 11g does not support rename and delete of security providers
66
40
4. Offline wlst in 11g and 12c does not support reorder of the security providers with the set statement.
67
41
42
+ The SecurityConfiguration is added if it does not exist. The default realm is added if it does not exist.
43
+ If it is not an 11g target domain, then configure the realms with merge to model with the providers
68
44
"""
69
45
__class_name = 'SecurityProviderHelper'
70
46
@@ -102,39 +78,14 @@ def create_security_configuration(self, location):
102
78
mbean_type , mbean_name = self .alias_helper .get_wlst_mbean_type_and_name (config_location )
103
79
self .wlst_helper .create (mbean_name , mbean_type )
104
80
105
- self .__handle_default_security_providers ()
106
- # This will leave 11g with the 'Provider' names. If future update is allowed, the update should handle
107
- # the 'Provider' if update is merge to model. Else, put code here to delete and re-add if in create and
108
- # no security configuration found in model.
81
+ # This will leave 11g asis with the default security realm for the current release. No configuration
82
+ # will be done to the 11g default security realm.
109
83
if len (security_configuration_nodes ) > 0 and self ._configure_security_configuration ():
110
84
self ._create_mbean (SECURITY_CONFIGURATION , security_configuration_nodes , location , log_created = True )
111
85
112
86
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
113
87
return
114
88
115
- def __handle_default_security_providers (self ):
116
- _method_name = '__handle_default_security_providers'
117
-
118
- self .logger .entering (class_name = self .__class_name , method_name = _method_name )
119
- location , default_realm_name = self .__get_default_realm_location ()
120
- #
121
- # Creating domains with the wls.jar template is busted for 11g domains with regards to the
122
- # names of the default authentication providers (both the DefaultAuthenticator and the
123
- # DefaultIdentityAsserter names are 'Provider', making it impossible to work with in WLST.
124
- if self .wls_helper .do_default_authentication_provider_names_need_fixing ():
125
- # put a log here
126
- self ._handle_default_provider (_get_default_adjudicators (), ADJUDICATOR , location )
127
- self ._handle_default_provider (_get_default_auditors (), AUDITOR , location )
128
- self ._handle_default_provider (_get_default_authentication_providers (), AUTHENTICATION_PROVIDER , location )
129
- self ._handle_default_provider (_get_default_authorizers (), AUTHORIZER , location )
130
- self ._handle_default_provider (_get_default_cert_path_providers (), CERT_PATH_PROVIDER , location )
131
- self ._handle_default_provider (_get_default_credential_mappers (), CREDENTIAL_MAPPER , location )
132
- self ._handle_default_provider (_get_default_password_validators (), PASSWORD_VALIDATOR , location )
133
- self ._handle_default_provider (_get_default_role_mappers (), ROLE_MAPPER , location )
134
-
135
- self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
136
- return
137
-
138
89
def __get_default_realm_location (self ):
139
90
"""
140
91
Ensure that the default realm exists and get the location object for it.
@@ -185,53 +136,11 @@ def _configure_security_configuration(self):
185
136
For this release, the update tool will not configure the security realm.
186
137
:return: True if can configure the SecurityConfiguration mbean
187
138
"""
188
- if not self ._domain_typedef .is_security_configuration_supported ():
139
+ _method_name = '_configure_security_configuration'
140
+ if not self .wls_helper .is_configure_security_configuration_supported ():
189
141
# Do we bypass or end the update ?
190
- self .logger .warning ('Unable to process SecurityConfiguration in update mode.' )
142
+ self .logger .warning ('Unable to configure the SecurityConfiguration in the target domain release {0}'
143
+ ' using weblogic-deploy {1}' , self .wls_helper .get_weblogic_version (),
144
+ WDTVersion .getVersion (), class_name = self .__class_name , method_name = _method_name )
191
145
return False
192
146
return True
193
-
194
- def _handle_default_provider (self , default_list , base_provider , base_location ):
195
- location = LocationContext (base_location )
196
- location .append_location (base_provider )
197
- list_path = self .alias_helper .get_wlst_list_path (location )
198
- existing_folder_names = self ._get_existing_folders (list_path )
199
- if len (existing_folder_names ) > 0 and 'Provider' in existing_folder_names :
200
- create_path = self .alias_helper .get_wlst_create_path (location )
201
- self .wlst_helper .cd (create_path )
202
- for provider , provider_type in default_list .iteritems ():
203
- self .wlst_helper .create (provider , provider_type , base_provider )
204
- return
205
-
206
-
207
- def _get_default_adjudicators ():
208
- return {DEFAULT_ADJUDICATOR_NAME : DEFAULT_ADJUDICATOR_TYPE }
209
-
210
-
211
- def _get_default_auditors ():
212
- return {DEFAULT_AUDITOR_NAME : DEFAULT_AUDITOR_TYPE }
213
-
214
-
215
- def _get_default_authentication_providers ():
216
- return {DEFAULT_AUTHENTICATOR_NAME : DEFAULT_AUTHENTICATOR_TYPE ,
217
- DEFAULT_IDENTITY_ASSERTER_NAME : DEFAULT_IDENTITY_ASSERTER_TYPE }
218
-
219
-
220
- def _get_default_authorizers ():
221
- return {DEFAULT_AUTHORIZER_NAME : DEFAULT_AUTHORIZER_TYPE }
222
-
223
-
224
- def _get_default_cert_path_providers ():
225
- return {DEFAULT_CERT_PATH_PROVIDER_NAME : DEFAULT_CERT_PATH_PROVIDER_TYPE }
226
-
227
-
228
- def _get_default_credential_mappers ():
229
- return {DEFAULT_CREDENTIAL_MAPPER_NAME : DEFAULT_CREDENTIAL_MAPPER_TYPE }
230
-
231
-
232
- def _get_default_password_validators ():
233
- return {DEFAULT_PASSWORD_VALIDATOR_NAME : DEFAULT_PASSWORD_VALIDATOR_TYPE }
234
-
235
-
236
- def _get_default_role_mappers ():
237
- return {DEFAULT_ROLE_MAPPER_NAME : DEFAULT_ROLE_MAPPER_TYPE }
0 commit comments