You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ma...@apache.org on 2024/03/04 03:58:09 UTC

(pulsar) branch branch-2.10 updated: Fix #22163 cherry-picking problem

This is an automated email from the ASF dual-hosted git repository.

mattisonchao pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new 4b5dba77943 Fix #22163 cherry-picking problem
4b5dba77943 is described below

commit 4b5dba77943797d6ad2a52979c9c168666376798
Author: Mattison Chao <ma...@apache.org>
AuthorDate: Mon Mar 4 11:56:58 2024 +0800

    Fix #22163 cherry-picking problem
---
 .../org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java
index 3243c04baa2..9c125caa0c8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java
@@ -19,12 +19,12 @@
 package org.apache.pulsar.broker.admin;
 
 import static org.awaitility.Awaitility.await;
+import com.google.common.collect.Sets;
 import io.jsonwebtoken.Jwts;
 import io.jsonwebtoken.SignatureAlgorithm;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 import java.util.UUID;
 import javax.crypto.SecretKey;
 import lombok.Cleanup;
@@ -75,9 +75,11 @@ public final class TopicPoliciesAuthZTest extends MockedPulsarServiceBaseTest {
     protected void setup() throws Exception {
         conf.setAuthorizationEnabled(true);
         conf.setAuthorizationProvider(PulsarAuthorizationProvider.class.getName());
-        conf.setSuperUserRoles(Set.of(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
+        conf.setSuperUserRoles(Sets.newHashSet(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
         conf.setAuthenticationEnabled(true);
-        conf.setAuthenticationProviders(Set.of(AuthenticationProviderToken.class.getName()));
+        conf.setSystemTopicEnabled(true);
+        conf.setTopicLevelPoliciesEnabled(true);
+        conf.setAuthenticationProviders(Sets.newHashSet(AuthenticationProviderToken.class.getName()));
         // internal client
         conf.setBrokerClientAuthenticationPlugin(AuthenticationToken.class.getName());
         final Map<String, String> brokerClientAuthParams = new HashMap<>();
@@ -192,7 +194,7 @@ public final class TopicPoliciesAuthZTest extends MockedPulsarServiceBaseTest {
         // test sub user with permissions
         for (AuthAction action : AuthAction.values()) {
             superUserAdmin.namespaces().grantPermissionOnNamespace("public/default",
-                    subject, Set.of(action));
+                    subject, Sets.newHashSet(action));
             try {
                 subAdmin.topicPolicies().getRetention(topic);
                 Assert.fail("unexpected behaviour");