GutoVeronezi commented on code in PR #8603:
URL: https://github.com/apache/cloudstack/pull/8603#discussion_r1491683963
##########
api/src/main/java/org/apache/cloudstack/config/ApiServiceConfiguration.java:
##########
@@ -29,6 +34,20 @@ public class ApiServiceConfiguration implements Configurable
{
"true", "Are the source checks on API calls enabled (true) or not
(false)? See api.allowed.source.cidr.list", true, ConfigKey.Scope.Global);
public static final ConfigKey<String> ApiAllowedSourceCidrList = new
ConfigKey<>(String.class, "api.allowed.source.cidr.list", "Advanced",
"0.0.0.0/0,::/0", "Comma separated list of IPv4/IPv6 CIDRs from
which API calls can be performed. Can be set on Global and Account levels.",
true, ConfigKey.Scope.Account, null, null, null, null, null,
ConfigKey.Kind.CSV, null);
+
+
+ public static void validateEndpointUrl() {
+ String csUrl = getApiServletPathValue();
+ if (StringUtils.isBlank(csUrl) || StringUtils.containsAny(csUrl,
"localhost", "127.0.0.1")) {
+ LOGGER.error(String.format("Global setting %s cannot contain
localhost or be blank. Current value: %s", ApiServletPath.key(), csUrl));
Review Comment:
```suggestion
LOGGER.error("Global setting [{}] cannot contain localhost or be
blank. Current value: {}", ApiServletPath.key(), csUrl);
```
--
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]