lhotari commented on code in PR #24860:
URL: https://github.com/apache/pulsar/pull/24860#discussion_r2436516563
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -1967,13 +1965,17 @@ protected BundlesData validateBundlesData(BundlesData
initialBundles) {
}
private CompletableFuture<Void> validatePoliciesAsync(NamespaceName ns,
Policies policies) {
- if (ns.isV2() && policies.replication_clusters.isEmpty()) {
- // Default to local cluster
- policies.replication_clusters =
Collections.singleton(config().getClusterName());
+ if (!policies.checkAllowedAndReplicationClusters()) {
+ String msg = String.format("[%s] All replication clusters should
be included in allowed clusters."
+ + " Repl clusters: %s, allowed clusters: %s",
+ ns.toString(), policies.replication_clusters,
policies.allowed_clusters);
+ log.info(msg);
+ throw new RestException(Status.FORBIDDEN, msg);
Review Comment:
`FORBIDDEN` seems to be the incorrect status code for input validation. The
correct one would be `BAD_REQUEST` (400).
--
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]