Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.brooklyn.util.collections.MutableMap;
import org.apache.brooklyn.util.core.BrooklynMavenArtifacts;
import org.apache.brooklyn.util.maven.MavenRetriever;
import org.apache.brooklyn.util.text.Identifiers;
import org.apache.brooklyn.util.text.Strings;
import org.apache.brooklyn.util.time.Duration;
import org.slf4j.Logger;
Expand Down Expand Up @@ -124,7 +125,7 @@ private Location createLocation() {
public void testObtain() {
String localUrl = MavenRetriever.localUrl(BrooklynMavenArtifacts.artifact("", "brooklyn-dist", "tar.gz", "dist"));
String userName = "admin";
String userPassword = Strings.makeRandomId(6);
String userPassword = Identifiers.makeRandomPassword(6);
String remoteConfig = Joiner.on('\n').join(MutableList.of(
"brooklyn.webconsole.security.users=" + userName,
"brooklyn.webconsole.security.user.admin.password=" + userPassword)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ protected String getUsername(){
}

protected String getUserPassword() {
return getConfigOrDefault(PostgreSqlNode.PASSWORD, Strings.makeRandomId(8));
return getConfigOrDefault(PostgreSqlNode.PASSWORD, Identifiers.makeRandomPassword(8));
}

protected void executeDatabaseCreationScript() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.brooklyn.util.text.Identifiers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -68,7 +69,7 @@ public void init() {
if (LOG.isInfoEnabled()) {
LOG.info(this + " cluster password not provided for " + CLUSTER_PASSWORD.getName() + " : generating random password");
}
config().set(CLUSTER_PASSWORD, Strings.makeRandomId(12));
config().set(CLUSTER_PASSWORD, Identifiers.makeRandomPassword(12));
}

policies().add(PolicySpec.create(MemberTrackingPolicy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.brooklyn.entity.nosql.mongodb;

import org.apache.brooklyn.util.text.Identifiers;
import org.apache.brooklyn.util.text.Strings;

import org.apache.brooklyn.api.entity.EntitySpec;
Expand Down Expand Up @@ -46,7 +47,7 @@ public static String getRootPassword(Entity entity) {
String password = entity.config().get(MongoDBAuthenticationMixins.ROOT_PASSWORD);
if (Strings.isEmpty(password)) {
LOG.debug(entity + " has no password specified for " + MongoDBAuthenticationMixins.ROOT_PASSWORD.getName() + "; using a random string");
password = Strings.makeRandomId(16);
password = Identifiers.makeRandomPassword(16);
entity.sensors().set(MongoDBAuthenticationMixins.ROOT_PASSWORD, password);
entity.config().set(MongoDBAuthenticationMixins.ROOT_PASSWORD, password);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.entity.software.base.SoftwareProcess;
import org.apache.brooklyn.entity.webapp.JavaWebAppSshDriver;
import org.apache.brooklyn.util.text.Identifiers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.brooklyn.location.ssh.SshMachineLocation;
Expand Down Expand Up @@ -145,7 +146,7 @@ public void customize() {
String managementPassword = getManagementPassword();
if (Strings.isBlank(managementPassword)) {
LOG.debug(this+" has no password specified for "+JBoss7Server.MANAGEMENT_PASSWORD.getName()+"; using a random string");
entity.config().set(JBoss7Server.MANAGEMENT_PASSWORD, Strings.makeRandomId(8));
entity.config().set(JBoss7Server.MANAGEMENT_PASSWORD, Identifiers.makeRandomPassword(8));
}
String hashedPassword = hashPassword(getManagementUsername(), getManagementPassword(), MANAGEMENT_REALM);

Expand Down