Skip to content
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

Add support for configurable max bucket & key length #8484

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

tangledbytes
Copy link
Member

Explain the changes

This PR adds support for configurable max key length in NooBaa. Amazon S3 supports maximum of 1024 bytes long key name while NooBaa does not have any such limits. This sometimes become problematic hence this PR adds support for a config variable named S3_MAX_KEY_LENGTH which defaults to Infinity for now implying no limit, however this can be changed to 1024 in config-local.js.

Issues: Fixed #xxx / Gap #xxx

Some known DBS3 issues.

Testing Instructions:

  • Doc added/updated
  • Tests added

@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 29, 2024
@tangledbytes tangledbytes changed the title Add support for configurable max key length Add support for configurable max bucket & key length Oct 29, 2024
@@ -90,6 +90,8 @@ async function handle_request(req, res) {
}
req.op_name = op_name;

http_utils.validate_bucket_name_object_key_length(req);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is relevant to sts/iam requests at all - we don't parse a bucket/key params in those servers.

@@ -105,6 +105,8 @@ async function handle_request(req, res) {
}
req.op_name = op_name;

http_utils.validate_bucket_name_object_key_length(req);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is relevant to sts/iam requests at all - we don't parse a bucket/key params in those servers.

@@ -121,6 +121,8 @@ async function handle_request(req, res) {
}
req.op_name = op_name;

http_utils.validate_bucket_name_object_key_length(req);
Copy link
Member

Choose a reason for hiding this comment

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

it seems more relevant in my opinion that this validation will be part of get_bucket_and_key()

@@ -702,6 +702,15 @@ function validate_server_ip_whitelist(req) {
throw new S3Error(S3Error.AccessDenied);
}

function validate_bucket_name_object_key_length(req) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this fits http_utils, it can just be in s3_rest, or if we need to share it then maybe in s3_utils

Signed-off-by: Utkarsh Srivastava <[email protected]>

add configurable for bucket name length

Signed-off-by: Utkarsh Srivastava <[email protected]>
@guymguym guymguym merged commit aef68ca into noobaa:master Oct 31, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants