This is an automated email from the ASF dual-hosted git repository.
zixuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 364c3c3a7f6 [cleanup][broker] Deprecate blocking AuthorizationService,
AuthorizationProvider methods (#19180)
364c3c3a7f6 is described below
commit 364c3c3a7f6aabdc8cbe7aff126f9ab5eee29424
Author: Michael Marshall <[email protected]>
AuthorDate: Thu Jan 12 02:51:22 2023 -0600
[cleanup][broker] Deprecate blocking AuthorizationService,
AuthorizationProvider methods (#19180)
---
.../authorization/AuthorizationProvider.java | 23 +++++++++++++++++++++-
.../broker/authorization/AuthorizationService.java | 16 +++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
index 9adc212019d..17bf83cd176 100644
---
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
+++
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
@@ -61,7 +61,8 @@ public interface AuthorizationProvider extends Closeable {
}
/**
- * @deprecated Use method {@link #isSuperUser(String,
AuthenticationDataSource, ServiceConfiguration)}
+ * @deprecated - Use method {@link #isSuperUser(String,
AuthenticationDataSource, ServiceConfiguration)}.
+ * Will be removed after 2.12.
* Check if specified role is a super user
* @param role the role to check
* @return a CompletableFuture containing a boolean in which true means
the role is a super user
@@ -297,6 +298,10 @@ public interface AuthorizationProvider extends Closeable {
operation.toString(), tenantName)));
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
default Boolean allowTenantOperation(String tenantName, String role,
TenantOperation operation,
AuthenticationDataSource authData) {
try {
@@ -326,6 +331,10 @@ public interface AuthorizationProvider extends Closeable {
+ "the Authorization provider you are using."));
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
default Boolean allowNamespaceOperation(NamespaceName namespaceName,
String role,
NamespaceOperation operation,
@@ -397,6 +406,10 @@ public interface AuthorizationProvider extends Closeable {
+ "is not supported by is not supported by the
Authorization provider you are using."));
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
default Boolean allowNamespacePolicyOperation(NamespaceName namespaceName,
PolicyName policy,
PolicyOperation operation,
@@ -471,6 +484,10 @@ public interface AuthorizationProvider extends Closeable {
+ "provider you are using."));
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
default Boolean allowTopicOperation(TopicName topicName,
String role,
TopicOperation operation,
@@ -541,6 +558,10 @@ public interface AuthorizationProvider extends Closeable {
+ "is not supported by the Authorization provider you
are using."));
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
default Boolean allowTopicPolicyOperation(TopicName topicName,
String role,
PolicyName policy,
diff --git
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
index 9e9e2e83238..526e8430d0f 100644
---
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
+++
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
@@ -353,6 +353,10 @@ public class AuthorizationService {
}
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
public boolean allowTenantOperation(String tenantName,
TenantOperation operation,
String originalRole,
@@ -451,6 +455,10 @@ public class AuthorizationService {
}
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
public boolean allowNamespacePolicyOperation(NamespaceName namespaceName,
PolicyName policy,
PolicyOperation operation,
@@ -513,6 +521,10 @@ public class AuthorizationService {
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
public Boolean allowTopicPolicyOperation(TopicName topicName,
PolicyName policy,
PolicyOperation operation,
@@ -595,6 +607,10 @@ public class AuthorizationService {
}
}
+ /**
+ * @deprecated - will be removed after 2.12. Use async variant.
+ */
+ @Deprecated
public Boolean allowTopicOperation(TopicName topicName,
TopicOperation operation,
String originalRole,