CASSSIDECAR-331: NullPointerException When Authentication Is Enabled but sidecar_internal Schema Is Disabled#250
CASSSIDECAR-331: NullPointerException When Authentication Is Enabled but sidecar_internal Schema Is Disabled#250sarankk wants to merge 8 commits intoapache:trunkfrom
Conversation
8135f4b to
e535fba
Compare
frankgh
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the fix. I have small comments
.../main/java/org/apache/cassandra/sidecar/acl/authentication/AuthenticationHandlerFactory.java
Show resolved
Hide resolved
...in/java/org/apache/cassandra/sidecar/acl/authentication/JwtAuthenticationHandlerFactory.java
Outdated
Show resolved
Hide resolved
...a/org/apache/cassandra/sidecar/acl/authentication/MutualTlsAuthenticationHandlerFactory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/cassandra/sidecar/modules/AuthModule.java
Outdated
Show resolved
Hide resolved
…nal Schema Is Disabled
…Module.java Co-authored-by: Francisco Guerrero <frank.guerrero@gmail.com>
…cation/MutualTlsAuthenticationHandlerFactory.java Co-authored-by: Francisco Guerrero <frank.guerrero@gmail.com>
…cation/JwtAuthenticationHandlerFactory.java Co-authored-by: Francisco Guerrero <frank.guerrero@gmail.com>
…cation/AuthenticationHandlerFactory.java Co-authored-by: Francisco Guerrero <frank.guerrero@gmail.com>
| * Invalidate a key. | ||
| * @param k key to invalidate | ||
| */ | ||
| public void invalidate(K k) |
There was a problem hiding this comment.
Where is this method being used?
| boolean isSidecarSchemaEnabled = sidecarConfiguration.serviceConfiguration() | ||
| .schemaKeyspaceConfiguration() | ||
| .isEnabled(); | ||
| if (!isSidecarSchemaEnabled) | ||
| { | ||
| throw new ConfigurationException("JwtAuthenticationHandlerFactory requires Sidecar schema to be enabled for role processing"); | ||
| } |
There was a problem hiding this comment.
Why not having this implementation in the default implementation of the interface?
There was a problem hiding this comment.
I don't think it makes sense to have this in the interface, because you don't know if the implementation requires sidecar schema. It only makes sense to have this check if you require sidecar schema for the implementation
| .isEnabled(); | ||
| if (!isSidecarSchemaEnabled) | ||
| { | ||
| throw new ConfigurationException("MutualTlsAuthenticationHandlerFactory requires Sidecar schema to be enabled for role processing"); |
There was a problem hiding this comment.
What about mentioning explicitly the flag that needs to be enabled on the config?
| { | ||
| if (!sidecarConfiguration.serviceConfiguration().schemaKeyspaceConfiguration().isEnabled()) | ||
| { | ||
| throw new ConfigurationException(config.className() + " requires Sidecar schema to be enabled for role permissions used by Sidecar"); |
There was a problem hiding this comment.
What about mentioning explicitly the flag that needs to be enabled on the config?
No description provided.