Skip to content

HDDS-14795. Move the character length check to the server if the strict S3 naming flag is enabled#10014

Open
Russole wants to merge 4 commits intoapache:masterfrom
Russole:HDDS-14795
Open

HDDS-14795. Move the character length check to the server if the strict S3 naming flag is enabled#10014
Russole wants to merge 4 commits intoapache:masterfrom
Russole:HDDS-14795

Conversation

@Russole
Copy link
Copy Markdown
Contributor

@Russole Russole commented Mar 31, 2026

What changes were proposed in this pull request?

  • Apply S3 bucket name length (3–63) validation only when strict S3 naming is enabled
  • Allow non-S3-compliant bucket names when strict S3 is disabled
  • Keep existing length validation unchanged for volume name

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14795

How was this patch tested?

@Russole
Copy link
Copy Markdown
Contributor Author

Russole commented Mar 31, 2026

Hi @sadanand48 , could you please review this PR when you have time? Thanks!

Copy link
Copy Markdown
Contributor

@Gargi-jais11 Gargi-jais11 left a comment

Choose a reason for hiding this comment

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

Thanks @Russole for the patch. Overall LGTM.
Just few minor comments.

@Test
public void preExecuteRejectsInvalidBucketName() {
// Verify invalid bucket name throws exception
public void preExecuteRejectsShortBucketNameWhenStrictS3Enabled() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make this Parameterised and pass both bucket name less than 3 length and bucket name greater than 63 length, then check suck bucket names should be rejected.

}

@Test
public void preExecuteAllowsShortBucketNameWhenStrictS3Disabled()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, you can check if isS3strict=false then larger bucket name ( > 63) is allowed.

@Russole
Copy link
Copy Markdown
Contributor Author

Russole commented Apr 1, 2026

Thanks @Gargi-jais11 for the review. I've updated the test to a parameterized test and covered both cases.

@Russole Russole requested a review from Gargi-jais11 April 1, 2026 16:31
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