sarankk commented on code in PR #165:
URL: https://github.com/apache/cassandra-sidecar/pull/165#discussion_r1905909489
##########
server/src/main/java/org/apache/cassandra/sidecar/server/MainModule.java:
##########
@@ -245,11 +256,52 @@ public ChainAuthHandler chainAuthHandler(Vertx vertx,
return chainAuthHandler;
}
+ @Provides
+ @Singleton
+ public AuthorizationProvider authorizationProvider(SidecarConfiguration
sidecarConfiguration,
+ IdentityToRoleCache
identityToRoleCache,
+ RoleAuthorizationsCache
roleAuthorizationsCache)
+ {
+ AccessControlConfiguration accessControlConfiguration =
sidecarConfiguration.accessControlConfiguration();
+ if (!accessControlConfiguration.enabled())
+ {
+ return AllowAllAuthorizationProvider.INSTANCE;
+ }
+
+ ParameterizedClassConfiguration config =
accessControlConfiguration.authorizerConfiguration();
+ if (config == null)
+ {
+ throw new ConfigurationException("Access control is enabled, but
authorizer not set");
+ }
Review Comment:
They can not leave authorizer field empty. When access control is enabled,
they can set it to `AllowAllAuthorizationProvider` if they do not want to
authorize users.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]