-
Notifications
You must be signed in to change notification settings - Fork 52
CASSSIDECAR-331: NullPointerException When Authentication Is Enabled but sidecar_internal Schema Is Disabled #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
8135f4b to
e535fba
Compare
frankgh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not having this implementation in the default implementation of the interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about mentioning explicitly the flag that needs to be enabled on the config?
No description provided.