GutoVeronezi commented on code in PR #7134:
URL: https://github.com/apache/cloudstack/pull/7134#discussion_r1087772093
##########
server/src/main/java/com/cloud/server/ManagementServerImpl.java:
##########
@@ -810,6 +810,7 @@ public class ManagementServerImpl extends ManagerBase
implements ManagementServe
protected StateMachine2<State, VirtualMachine.Event, VirtualMachine>
_stateMachine;
static final ConfigKey<Integer> vmPasswordLength = new
ConfigKey<Integer>("Advanced", Integer.class, "vm.password.length", "6",
"Specifies the length of a randomly generated password", false);
+ static final ConfigKey<String> vmPasswordComplexity = new
ConfigKey<String>("Advanced", String.class, "vm.password.complexity",
"^(?=.{6,})(?=.*[A-Z])(?=.*[a-z])(?=.*[@#%&^~.,!,?,:,;])", "Specifies the
pattern for generated password", false);
Review Comment:
@Pavan-Nambi, to keep compatibility with the current behavior (accept any
password generated), the default value should be `.*`; then, one should change
the configuration via API/UI according to the necessity.
Also, the last parameter of this constructor refers to the dynamism of the
configuration. If `false`, it means when we change the configuration, we should
restart the management server in order to load the new value; if `true`, it
means the next time the configuration is used it will be reloaded. For this
case, I do not think it is necessary to restart the management server; then, it
could be `true`.
##########
server/src/main/java/com/cloud/server/ManagementServerImpl.java:
##########
@@ -1095,7 +1096,12 @@ protected Map<String, String> getConfigs() {
@Override
public String generateRandomPassword() {
final Integer passwordLength = vmPasswordLength.value();
- return PasswordGenerator.generateRandomPassword(passwordLength);
+ String pswd= PasswordGenerator.generateRandomPassword(passwordLength);
Review Comment:
Currently `PasswordGenerator` is only working with alpha numeric characters;
therefore, to meet the need you presented, this class should be extended to
work with other symbols.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]