public class PulsarAuthorizationProvider extends Object implements AuthorizationProvider
| Modifier and Type | Field and Description |
|---|---|
ServiceConfiguration |
conf |
ConfigurationCacheService |
configCache |
| Constructor and Description |
|---|
PulsarAuthorizationProvider() |
PulsarAuthorizationProvider(ServiceConfiguration conf,
ConfigurationCacheService configCache) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
allowFunctionOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
String role,
AuthenticationDataSource authenticationData)
Allow all function operations with in this namespace
|
CompletableFuture<Boolean> |
allowNamespaceOperationAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
String role,
org.apache.pulsar.common.policies.data.NamespaceOperation operation,
AuthenticationDataSource authData)
Check if a given role is allowed to execute a given operation on the namespace.
|
CompletableFuture<Boolean> |
allowNamespacePolicyOperationAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
org.apache.pulsar.common.policies.data.PolicyName policy,
org.apache.pulsar.common.policies.data.PolicyOperation operation,
String role,
AuthenticationDataSource authData)
Check if a given role is allowed to execute a given policy operation on the namespace.
|
CompletableFuture<Boolean> |
allowSinkOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
String role,
AuthenticationDataSource authenticationData)
Allow all sink operations with in this namespace
|
CompletableFuture<Boolean> |
allowSourceOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
String role,
AuthenticationDataSource authenticationData)
Allow all source operations with in this namespace
|
CompletableFuture<Boolean> |
allowTenantOperationAsync(String tenantName,
String role,
org.apache.pulsar.common.policies.data.TenantOperation operation,
AuthenticationDataSource authData)
Check if a given role is allowed to execute a given operation on the tenant.
|
CompletableFuture<Boolean> |
allowTopicOperationAsync(org.apache.pulsar.common.naming.TopicName topicName,
String role,
org.apache.pulsar.common.policies.data.TopicOperation operation,
AuthenticationDataSource authData)
Check if a given role is allowed to execute a given topic operation on the topic.
|
CompletableFuture<Boolean> |
canConsumeAsync(org.apache.pulsar.common.naming.TopicName topicName,
String role,
AuthenticationDataSource authenticationData,
String subscription)
Check if the specified role has permission to receive messages from the specified fully qualified topic
name.
|
CompletableFuture<Boolean> |
canLookupAsync(org.apache.pulsar.common.naming.TopicName topicName,
String role,
AuthenticationDataSource authenticationData)
Check whether the specified role can perform a lookup for the specified topic.
|
CompletableFuture<Boolean> |
canProduceAsync(org.apache.pulsar.common.naming.TopicName topicName,
String role,
AuthenticationDataSource authenticationData)
Check if the specified role has permission to send messages to the specified fully qualified topic name.
|
CompletableFuture<Boolean> |
checkPermission(org.apache.pulsar.common.naming.TopicName topicName,
String role,
org.apache.pulsar.common.policies.data.AuthAction action) |
void |
close() |
CompletableFuture<Void> |
grantPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName,
Set<org.apache.pulsar.common.policies.data.AuthAction> actions,
String role,
String authDataJson)
Grant authorization-action permission on a namespace to the given client
|
CompletableFuture<Void> |
grantPermissionAsync(org.apache.pulsar.common.naming.TopicName topicName,
Set<org.apache.pulsar.common.policies.data.AuthAction> actions,
String role,
String authDataJson)
Grant authorization-action permission on a topic to the given client
|
CompletableFuture<Void> |
grantSubscriptionPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespace,
String subscriptionName,
Set<String> roles,
String authDataJson)
Grant permission to roles that can access subscription-admin api
|
void |
initialize(ServiceConfiguration conf,
ConfigurationCacheService configCache)
Perform initialization for the authorization provider
|
CompletableFuture<Void> |
revokeSubscriptionPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespace,
String subscriptionName,
String role,
String authDataJson)
Revoke subscription admin-api access for a role
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallowNamespaceOperation, allowNamespaceOperation, allowNamespaceOperationAsync, allowNamespacePolicyOperation, allowNamespacePolicyOperation, allowNamespacePolicyOperationAsync, allowTenantOperation, allowTenantOperation, allowTenantOperationAsync, allowTopicOperation, allowTopicOperation, allowTopicOperationAsync, isSuperUser, isSuperUser, isTenantAdminpublic ServiceConfiguration conf
public ConfigurationCacheService configCache
public PulsarAuthorizationProvider()
public PulsarAuthorizationProvider(ServiceConfiguration conf, ConfigurationCacheService configCache) throws IOException
IOExceptionpublic void initialize(ServiceConfiguration conf, ConfigurationCacheService configCache) throws IOException
AuthorizationProviderinitialize in interface AuthorizationProviderconf - broker config objectconfigCache - pulsar zk configuration cache serviceIOException - if the initialization failspublic CompletableFuture<Boolean> canProduceAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, AuthenticationDataSource authenticationData)
canProduceAsync in interface AuthorizationProvidertopicName - the fully qualified topic name associated with the topic.role - the app id used to send messages to the topic.public CompletableFuture<Boolean> canConsumeAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, AuthenticationDataSource authenticationData, String subscription)
canConsumeAsync in interface AuthorizationProvidertopicName - the fully qualified topic name associated with the topic.role - the app id used to receive messages from the topic.subscription - the subscription name defined by the clientpublic CompletableFuture<Boolean> canLookupAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, AuthenticationDataSource authenticationData)
canLookupAsync in interface AuthorizationProvidertopicName - role - Exceptionpublic CompletableFuture<Boolean> allowFunctionOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData)
AuthorizationProviderallowFunctionOpsAsync in interface AuthorizationProvidernamespaceName - The namespace that the function operations can be executed inrole - The role to checkauthenticationData - authentication data related to the rolepublic CompletableFuture<Boolean> allowSourceOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData)
AuthorizationProviderallowSourceOpsAsync in interface AuthorizationProvidernamespaceName - The namespace that the sources operations can be executed inrole - The role to checkauthenticationData - authentication data related to the rolepublic CompletableFuture<Boolean> allowSinkOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData)
AuthorizationProviderallowSinkOpsAsync in interface AuthorizationProvidernamespaceName - The namespace that the sink operations can be executed inrole - The role to checkauthenticationData - authentication data related to the rolepublic CompletableFuture<Void> grantPermissionAsync(org.apache.pulsar.common.naming.TopicName topicName, Set<org.apache.pulsar.common.policies.data.AuthAction> actions, String role, String authDataJson)
AuthorizationProvidergrantPermissionAsync in interface AuthorizationProviderauthDataJson - additional authdata in json formatpublic CompletableFuture<Void> grantPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, Set<org.apache.pulsar.common.policies.data.AuthAction> actions, String role, String authDataJson)
AuthorizationProvidergrantPermissionAsync in interface AuthorizationProviderauthDataJson - additional authdata in json formatpublic CompletableFuture<Void> grantSubscriptionPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespace, String subscriptionName, Set<String> roles, String authDataJson)
AuthorizationProvidergrantSubscriptionPermissionAsync in interface AuthorizationProviderauthDataJson - additional authdata in json formatpublic CompletableFuture<Void> revokeSubscriptionPermissionAsync(org.apache.pulsar.common.naming.NamespaceName namespace, String subscriptionName, String role, String authDataJson)
AuthorizationProviderrevokeSubscriptionPermissionAsync in interface AuthorizationProviderpublic CompletableFuture<Boolean> checkPermission(org.apache.pulsar.common.naming.TopicName topicName, String role, org.apache.pulsar.common.policies.data.AuthAction action)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic CompletableFuture<Boolean> allowTenantOperationAsync(String tenantName, String role, org.apache.pulsar.common.policies.data.TenantOperation operation, AuthenticationDataSource authData)
AuthorizationProviderallowTenantOperationAsync in interface AuthorizationProvidertenantName - tenant namerole - role nameoperation - tenant operationauthData - authenticated data of the rolepublic CompletableFuture<Boolean> allowNamespaceOperationAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, org.apache.pulsar.common.policies.data.NamespaceOperation operation, AuthenticationDataSource authData)
AuthorizationProviderallowNamespaceOperationAsync in interface AuthorizationProvidernamespaceName - namespace namerole - role nameoperation - namespace operationauthData - authenticated datapublic CompletableFuture<Boolean> allowNamespacePolicyOperationAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, org.apache.pulsar.common.policies.data.PolicyName policy, org.apache.pulsar.common.policies.data.PolicyOperation operation, String role, AuthenticationDataSource authData)
AuthorizationProviderallowNamespacePolicyOperationAsync in interface AuthorizationProvidernamespaceName - namespace namepolicy - policy nameoperation - policy operationrole - role nameauthData - authenticated datapublic CompletableFuture<Boolean> allowTopicOperationAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, org.apache.pulsar.common.policies.data.TopicOperation operation, AuthenticationDataSource authData)
AuthorizationProviderallowTopicOperationAsync in interface AuthorizationProvidertopicName - topic namerole - role nameoperation - topic operationauthData - authenticated dataCopyright © 2017–2021 Apache Software Foundation. All rights reserved.