public class MultiRolesTokenAuthorizationProvider extends PulsarAuthorizationProvider
conf| Constructor and Description |
|---|
MultiRolesTokenAuthorizationProvider() |
| 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> |
allowTopicPolicyOperationAsync(org.apache.pulsar.common.naming.TopicName topicName,
String role,
org.apache.pulsar.common.policies.data.PolicyName policyName,
org.apache.pulsar.common.policies.data.PolicyOperation policyOperation,
AuthenticationDataSource authData)
Check if a given role is allowed to execute a given topic operation on topic's policy.
|
CompletableFuture<Boolean> |
authorize(AuthenticationDataSource authenticationData,
Function<String,CompletableFuture<Boolean>> authorizeFunc) |
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.
|
void |
initialize(ServiceConfiguration conf,
PulsarResources pulsarResources)
Perform initialization for the authorization provider
|
checkPermission, close, grantPermissionAsync, grantPermissionAsync, grantSubscriptionPermissionAsync, revokeSubscriptionPermissionAsync, validateTenantAdminAccessclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallowNamespaceOperation, allowNamespaceOperation, allowNamespaceOperationAsync, allowNamespacePolicyOperation, allowNamespacePolicyOperation, allowNamespacePolicyOperationAsync, allowTenantOperation, allowTenantOperation, allowTenantOperationAsync, allowTopicOperation, allowTopicOperation, allowTopicOperationAsync, allowTopicPolicyOperation, initialize, isSuperUser, isSuperUser, isTenantAdminpublic MultiRolesTokenAuthorizationProvider()
public void initialize(ServiceConfiguration conf, PulsarResources pulsarResources) throws IOException
AuthorizationProviderinitialize in interface AuthorizationProviderinitialize in class PulsarAuthorizationProviderconf - broker config objectpulsarResources - Resources component for access to metadataIOException - if the initialization failspublic CompletableFuture<Boolean> authorize(AuthenticationDataSource authenticationData, Function<String,CompletableFuture<Boolean>> authorizeFunc)
public CompletableFuture<Boolean> canProduceAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, AuthenticationDataSource authenticationData)
canProduceAsync in interface AuthorizationProvidercanProduceAsync in class PulsarAuthorizationProvidertopicName - 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 AuthorizationProvidercanConsumeAsync in class PulsarAuthorizationProvidertopicName - 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)
For that the caller needs to have producer or consumer permission.
canLookupAsync in interface AuthorizationProvidercanLookupAsync in class PulsarAuthorizationProvidertopicName - role - Exceptionpublic CompletableFuture<Boolean> allowFunctionOpsAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData)
AuthorizationProviderallowFunctionOpsAsync in interface AuthorizationProviderallowFunctionOpsAsync in class PulsarAuthorizationProvidernamespaceName - 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 AuthorizationProviderallowSourceOpsAsync in class PulsarAuthorizationProvidernamespaceName - 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 AuthorizationProviderallowSinkOpsAsync in class PulsarAuthorizationProvidernamespaceName - The namespace that the sink operations can be executed inrole - The role to checkauthenticationData - authentication data related to the rolepublic CompletableFuture<Boolean> allowTenantOperationAsync(String tenantName, String role, org.apache.pulsar.common.policies.data.TenantOperation operation, AuthenticationDataSource authData)
AuthorizationProviderallowTenantOperationAsync in interface AuthorizationProviderallowTenantOperationAsync in class PulsarAuthorizationProvidertenantName - 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 AuthorizationProviderallowNamespaceOperationAsync in class PulsarAuthorizationProvidernamespaceName - 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 AuthorizationProviderallowNamespacePolicyOperationAsync in class PulsarAuthorizationProvidernamespaceName - 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 AuthorizationProviderallowTopicOperationAsync in class PulsarAuthorizationProvidertopicName - topic namerole - role nameoperation - topic operationauthData - authenticated datapublic CompletableFuture<Boolean> allowTopicPolicyOperationAsync(org.apache.pulsar.common.naming.TopicName topicName, String role, org.apache.pulsar.common.policies.data.PolicyName policyName, org.apache.pulsar.common.policies.data.PolicyOperation policyOperation, AuthenticationDataSource authData)
AuthorizationProviderallowTopicPolicyOperationAsync in interface AuthorizationProviderallowTopicPolicyOperationAsync in class PulsarAuthorizationProvidertopicName - topic namerole - role namepolicyOperation - topic operationauthData - authenticated dataCopyright © 2017–2021 Apache Software Foundation. All rights reserved.