-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[S3] Validate parts in multi-part upload (#2981)
Validate individual parts in S3 multi-part upload request --------- Co-authored-by: Shan Xu <[email protected]> Co-authored-by: Sanketh Nalli <[email protected]>
- Loading branch information
1 parent
6683f02
commit 3e96437
Showing
3 changed files
with
174 additions
and
3 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2024 LinkedIn Corp. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
*/ | ||
package com.github.ambry.frontend.s3; | ||
|
||
public class S3Constants { | ||
public static final int MIN_PART_NUM = 1; | ||
public static final int MAX_PART_NUM = 10000; | ||
public static final int MAX_LIST_SIZE = 10000; | ||
|
||
// Error Messages | ||
public static final String ERR_INVALID_PART_NUMBER = | ||
"Invalid part number: %d. Part number must be an integer between %d and %d."; | ||
public static final String ERR_DUPLICATE_PART_NUMBER = "Duplicate part number found: %d."; | ||
public static final String ERR_DUPLICATE_ETAG = "Duplicate eTag found: %s."; | ||
public static final String ERR_EMPTY_REQUEST_BODY = "Xml request body cannot be empty."; | ||
public static final String ERR_PART_LIST_TOO_LONG = String.format("Parts list size cannot exceed %d.", MAX_LIST_SIZE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters