Skip to content

CASSSIDECAR-461: Validate snapshot name during list snapshot#348

Open
frankgh wants to merge 3 commits into
apache:trunkfrom
frankgh:CASSSIDECAR-461
Open

CASSSIDECAR-461: Validate snapshot name during list snapshot#348
frankgh wants to merge 3 commits into
apache:trunkfrom
frankgh:CASSSIDECAR-461

Conversation

@frankgh
Copy link
Copy Markdown
Contributor

@frankgh frankgh commented May 14, 2026

Patch by Francisco Guerrero; reviewed by TBD for CASSSIDECAR-461

*/
String validateSnapshotName(@NotNull String snapshotName);
default String validateSnapshotName(@NotNull String snapshotName)
{
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved implementation to default implementation in the interface. RegexBasedCassandraInputValidator didn't seem the appropriate place for a non-regex validation

return SnapshotRequestParam.builder()
.qualifiedTableName(qualifiedTableName(context))
.snapshotName(context.pathParam("snapshot"))
.snapshotName(validator.validateSnapshotName(context.pathParam("snapshot")))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized this might not be a real issue because we can't have / or \0 (null character) in the path parameter. I tried coming up with a test, but the request fails before reaching the snapshot handler with a 404 (because the route is incorrect). I think we should still do the validation here in case in the future the snapshot name validation changes.

@frankgh frankgh force-pushed the CASSSIDECAR-461 branch from 3e2281e to b280f1a Compare May 21, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants