Merge "Omaha #4448 Added default user to registry" into omaha_16.1.1
Former-commit-id: 0292c93228a4a45a1f92e33b34797c3871645757
This commit is contained in:
commit
7d6872dc30
4 changed files with 39 additions and 21 deletions
|
@ -30,7 +30,6 @@
|
|||
<include>ebxml.*\.xml</include>
|
||||
<include>eventbus-common.xml</include>
|
||||
<include>edex-security.xml</include>
|
||||
<include>request-service-common.xml</include>
|
||||
<include>geo-common.xml</include>
|
||||
</mode>
|
||||
</edexModes>
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
<property name="federatedRegistryMonitor" ref="FederatedRegistryMonitor" />
|
||||
<property name="federationDbInit" ref="FederationDbInit" />
|
||||
<property name="registryUsers" ref="registryUsers" />
|
||||
<property name="securityConfig" ref="securityConfiguration"/>
|
||||
</bean>
|
||||
|
||||
<bean id="defineRegistryQuery"
|
||||
|
|
|
@ -119,6 +119,7 @@ import com.raytheon.uf.edex.registry.federation.FederationProperties;
|
|||
import com.raytheon.uf.edex.registry.federation.NotificationServers;
|
||||
import com.raytheon.uf.edex.registry.federation.RegistryNotFoundException;
|
||||
import com.raytheon.uf.edex.registry.federation.ReplicationEvent;
|
||||
import com.raytheon.uf.edex.security.SecurityConfiguration;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -171,6 +172,7 @@ import com.raytheon.uf.edex.registry.federation.ReplicationEvent;
|
|||
* 7/28/2014 2752 dhladky Fixed bad registry user name.
|
||||
* 8/27/2014 3560 bphillip Added updateRegistryEvents method
|
||||
* 5/11/2015 4448 bphillip Separated EBXML Registry from Data Delivery
|
||||
* 5/29/2015 4448 bphillip Added default user to registry on startup
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -296,6 +298,8 @@ public class RegistryFederationManager implements IRegistryFederationManager,
|
|||
|
||||
private RegistryUsers registryUsers;
|
||||
|
||||
private SecurityConfiguration securityConfig;
|
||||
|
||||
public RegistryFederationManager() throws JAXBException {
|
||||
jaxbManager = new JAXBManager(SubmitObjectsRequest.class,
|
||||
FederationProperties.class, NotificationServers.class,
|
||||
|
@ -390,20 +394,32 @@ public class RegistryFederationManager implements IRegistryFederationManager,
|
|||
* If this is the central registry then we ensure that the superuser is
|
||||
* in the registry
|
||||
*/
|
||||
if (centralRegistry
|
||||
&& !registryUsers.userExists(RegistryUtil.registryUser)) {
|
||||
/*
|
||||
* The registry super user initially gets the default password which
|
||||
* *must* be changed immediately
|
||||
*/
|
||||
try {
|
||||
try {
|
||||
if (centralRegistry
|
||||
&& !registryUsers.userExists(RegistryUtil.registryUser)) {
|
||||
/*
|
||||
* The registry super user initially gets the default password
|
||||
* which *must* be changed immediately
|
||||
*/
|
||||
registryUsers.addUser(RegistryUtil.registryUser, "password",
|
||||
"RegistryAdministrator");
|
||||
} catch (MsgRegistryException e) {
|
||||
throw new EbxmlRegistryException(
|
||||
"Error adding default registry user!", e);
|
||||
|
||||
} else if (!centralRegistry
|
||||
&& !registryUsers.userExists(securityConfig
|
||||
.getSecurityProperties().getProperty(
|
||||
"edex.security.auth.user"))) {
|
||||
registryUsers.addUser(
|
||||
securityConfig.getSecurityProperties().getProperty(
|
||||
"edex.security.auth.user"),
|
||||
securityConfig.getSecurityProperties().getProperty(
|
||||
"edex.security.auth.password"),
|
||||
"RegistryLocalAdministrator");
|
||||
}
|
||||
} catch (MsgRegistryException e) {
|
||||
throw new EbxmlRegistryException(
|
||||
"Error adding default registry user!", e);
|
||||
}
|
||||
|
||||
initialized.set(true);
|
||||
}
|
||||
|
||||
|
@ -1343,4 +1359,11 @@ public class RegistryFederationManager implements IRegistryFederationManager,
|
|||
this.restClient = restClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param securityConfig
|
||||
* the securityConfig to set
|
||||
*/
|
||||
public void setSecurityConfig(SecurityConfiguration securityConfig) {
|
||||
this.securityConfig = securityConfig;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ import com.raytheon.uf.common.security.encryption.AESEncryptor;
|
|||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.ClusterIdUtil;
|
||||
import com.raytheon.uf.edex.registry.ebxml.RegistryUsers;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PersonDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.RegistryRESTServices;
|
||||
|
@ -66,6 +65,7 @@ import com.raytheon.uf.edex.security.SecurityConfiguration;
|
|||
* 7/10/2014 1717 bphillip Initial creation
|
||||
* 7/24/2014 1712 bphillip No longer singleton
|
||||
* 1/06/2015 3918 dhladky Fixed issue where clients can't start without central registry.
|
||||
* 5/29/2015 4448 bphillip Added default user to registry on startup
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -105,13 +105,7 @@ public class CredentialCache {
|
|||
.getHandler(CredentialCache.class);
|
||||
|
||||
/** used in non federated standalone environment */
|
||||
private static final String DEFAULT_USER = "DEFAULT_USER_"+ClusterIdUtil.getId();
|
||||
|
||||
/** used in non federated standalone environment */
|
||||
private static final String DEFAULT_PASSWORD = "DEFAULT_PASSWORD_"+ClusterIdUtil.getId();
|
||||
|
||||
/** used in non federated standalone environment */
|
||||
private static final String DEFAULT_ROLE = "DEFAULT_ROLE_"+ClusterIdUtil.getId();
|
||||
private static final String DEFAULT_ROLE = "RegistryLocalAdministrator";
|
||||
|
||||
/** Cache holding users' credentials */
|
||||
private LoadingCache<String, String[]> credentialCache = CacheBuilder
|
||||
|
@ -205,8 +199,9 @@ public class CredentialCache {
|
|||
statusHandler
|
||||
.handle(Priority.INFO,
|
||||
"Federation not enabled! Proceeding with default user, pass, and role!");
|
||||
localUserName = DEFAULT_USER;
|
||||
password = DEFAULT_PASSWORD;
|
||||
localUserName = securityConfig.getProperty("edex.security.auth.user");
|
||||
password = securityConfig.getSecurityProperties().getProperty(
|
||||
"edex.security.auth.password");
|
||||
role = DEFAULT_ROLE;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue