Class RestAuthorizer
java.lang.Object
io.confluent.security.auth.client.RestAuthorizer
- All Implemented Interfaces:
io.confluent.security.authorizer.Authorizer,Closeable,AutoCloseable,org.apache.kafka.common.Configurable
This is the implementation of
Authorizer which connects to the given metadata service Urls
to perform the operations.
An instance of RestAuthorizer can be instantiated by passing configuration properties like below.
Mapinvalid input: '<'String, Object> configs = new HashMapinvalid input: '<'>();
configs.put(RestClientConfig.BOOTSTRAP_METADATA_SERVER_URLS_PROP, "http://localhost:8080");
Authorizer RestAuthorizer = new RestAuthorizer();
rbacRestAuthorizer.configure(configs);
There are different options available as mentioned in RestClientConfig like
-RestClientConfig.BOOTSTRAP_METADATA_SERVER_URLS_PROP. -RestClientConfig.METADATA_SERVER_URL_MAX_AGE_PROP. -RestClientConfig.BASIC_AUTH_CREDENTIALS_PROVIDER_PROP. -RestClientConfig.BASIC_AUTH_USER_INFO_PROP.
This can be used to authorize list of Action for a given userPrincipal
-
Constructor Summary
ConstructorsConstructorDescriptionRestAuthorizer(io.confluent.security.auth.client.rest.RestClient restClient) -
Method Summary
Modifier and TypeMethodDescriptionList<io.confluent.security.authorizer.AuthorizeResult> authorize(io.confluent.security.auth.client.provider.HttpCredentialProvider credentialProvider, org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, String host, List<io.confluent.security.authorizer.Action> actions) List<io.confluent.security.authorizer.AuthorizeResult> authorize(io.confluent.security.authorizer.RequestContext requestContext, List<io.confluent.security.authorizer.Action> actions) List<io.confluent.security.authorizer.AuthorizeResult> authorize(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, String host, List<io.confluent.security.authorizer.Action> actions) voidclose()voidMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.security.authorizer.Authorizer
authorize, authorize
-
Constructor Details
-
RestAuthorizer
public RestAuthorizer() -
RestAuthorizer
public RestAuthorizer(io.confluent.security.auth.client.rest.RestClient restClient)
-
-
Method Details
-
configure
-
authorize
-
authorize
-
authorize
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-