public class RestAuthorizer extends Object implements io.confluent.security.authorizer.Authorizer
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.
Map configs = new HashMap<>();
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 and Description |
|---|
RestAuthorizer() |
RestAuthorizer(RestClient restClient) |
| Modifier and Type | Method and Description |
|---|---|
List<io.confluent.security.authorizer.AuthorizeResult> |
authorize(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(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) |
void |
close() |
void |
configure(Map<String,?> configs) |
public RestAuthorizer()
public RestAuthorizer(RestClient restClient)
public void configure(Map<String,?> configs)
configure in interface org.apache.kafka.common.Configurablepublic List<io.confluent.security.authorizer.AuthorizeResult> authorize(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, String host, List<io.confluent.security.authorizer.Action> actions)
authorize in interface io.confluent.security.authorizer.Authorizerpublic List<io.confluent.security.authorizer.AuthorizeResult> authorize(io.confluent.security.authorizer.RequestContext requestContext, List<io.confluent.security.authorizer.Action> actions)
authorize in interface io.confluent.security.authorizer.Authorizerpublic List<io.confluent.security.authorizer.AuthorizeResult> authorize(HttpCredentialProvider credentialProvider, org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, String host, List<io.confluent.security.authorizer.Action> actions)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException