You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: framework/security/src/main/java/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
+14-9Lines changed: 14 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@
30
30
31
31
importjavax.inject.Inject;
32
32
33
+
importcom.cloud.utils.Pair;
33
34
importorg.apache.commons.lang3.StringUtils;
34
35
importorg.springframework.stereotype.Component;
35
36
@@ -45,24 +46,28 @@ public class KeystoreManagerImpl extends ManagerBase implements KeystoreManager
for (ActionEventactionEvent : getActionEvents(method)) {
89
89
CallContextctx = CallContext.current();
90
90
longuserId = ctx.getCallingUserId();
91
-
longaccountId = ctx.getProject() != null ? ctx.getProject().getProjectAccountId() : ctx.getCallingAccountId(); //This should be the entity owner id rather than the Calling User Account Id.
longaccountId = ctx.getProject() != null ? ctx.getProject().getProjectAccountId() :ctx.getCallingAccountId(); //This should be the entity owner id rather than the Calling User Account Id.
longaccountId = ctx.getProject() != null && !mainProjectEvents.stream().anyMatch(eventType::equalsIgnoreCase) ? ctx.getProject().getProjectAccountId() : callingAccountId; //This should be the entity owner id rather than the Calling User Account Id.
Pair<Boolean, String> result = _ksMgr.validateCertificate(certificate, key, domainSuffix);
4602
+
if (!result.first()) {
4603
+
thrownewInvalidParameterValueException(String.format("Failed to pass certificate validation check with error: %s", result.second()));
4604
+
}
4605
+
} else {
4606
+
try {
4607
+
logger.debug(String.format("Trying to validate the root certificate format"));
4608
+
CertificateHelper.buildCertificate(certificate);
4609
+
} catch (CertificateExceptione) {
4610
+
StringerrorMsg = String.format("Failed to pass certificate validation check with error: Certificate validation failed due to exception: %s", e.getMessage());
if (finalRootDiskController.matches(scsiControllerPattern)) {
4792
+
logger.info(String.format("Data disk controller was not defined, but root disk is using SCSI controller [%s]." +
4793
+
"To ensure disk controllers are available for the data disks, the data disk controller is updated to match the root disk controller.", finalRootDiskController));
0 commit comments