Copilot commented on code in PR #13818:
URL: https://github.com/apache/cloudstack/pull/13818#discussion_r3758004055
##########
server/src/main/java/org/apache/cloudstack/network/ssl/CertServiceImpl.java:
##########
@@ -128,6 +128,18 @@ public CertServiceImpl() {
public SslCertResponse uploadSslCert(final UploadSslCertCmd certCmd) {
Preconditions.checkNotNull(certCmd);
+ final CallContext ctx = CallContext.current();
+ final Account caller = ctx.getCallingAccount();
+
+ Account owner = null;
+ if (StringUtils.isNotBlank(certCmd.getAccountName())) {
+ owner = _accountMgr.finalizeOwner(caller,
certCmd.getAccountName(), certCmd.getDomainId(), certCmd.getProjectId());
+ } else {
+ owner = caller;
+ }
Review Comment:
uploadSslCert(): when projectId is provided without an account name, the
owner now falls back to the caller. This changes the documented behavior of
uploading a cert for a project (it should be owned by the project account), and
can persist the certificate under the wrong account/domain.
--
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]