You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Sreeja (Jira)" <ji...@apache.org> on 2025/05/20 12:45:00 UTC

[jira] [Comment Edited] (HDDS-12911) Add key name validation to AWS S3 PutObject API

    [ https://issues.apache.org/jira/browse/HDDS-12911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952847#comment-17952847 ] 

Sreeja edited comment on HDDS-12911 at 5/20/25 12:44 PM:
---------------------------------------------------------

Example case for this scenario :

*Before key name validation:*
aws s3api --endpoint [http://localhost:9878/] put-object --bucket fsobuck --key sampledir:1/samplekey --no-verify-ssl 
this has no error and gets created successfully.
but when we try to delete it we get an error as follows,
{{An error occurred (500) when calling the DeleteObject operation (reached max retries: 4): Internal Server Error}}

*After key name validation:*
{{{}aws s3api --endpoint [http://localhost:9878/] put-object --bucket fsobuck --key sampledir:1/{}}}{{{}samplekey{}}}--no-verify-ssl 
this would return
{{An error occurred (InvalidRequest) when calling the PutObject operation: Invalid key path: key names cannot include: }}
{{{ } < > ^ % ~ # | ` [ ] : \" or any non-ASCII characters.}}

{{{{}}{}}}{{{{}}{}}}Hence the object who's name contains invalid characters will not created.


was (Author: JIRAUSER308351):
Example case for this scenario :

*Before key name validation:*
{{aws s3api --endpoint http://localhost:9878/ put-object --bucket fsobuck --key sampledir:1/samplekey --no-verify-ssl }}
this has no error and gets created successfully.
but when we try to delete it we get an error as follows,
{{An error occurred (500) when calling the DeleteObject operation (reached max retries: 4): Internal Server Error}}

*After key name validation:*
{{{}aws s3api --endpoint http://localhost:9878/ put-object --bucket fsobuck --key sampledir:1/{}}}{{{}samplekey{}}}{{ --no-verify-ssl }}
this would return
{{An error occurred (InvalidRequest) when calling the PutObject operation: Invalid key path: key names cannot include: \\ \{ } < > ^ % ~ # | ` [ ] : \" or any non-ASCII characters.}}

{{{}{}}}{{{}{}}}Hence the object who's name contains invalid characters will not created.

> Add key name validation to AWS S3 PutObject API
> -----------------------------------------------
>
>                 Key: HDDS-12911
>                 URL: https://issues.apache.org/jira/browse/HDDS-12911
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Sarveksha Yeshavantha Raju
>            Assignee: Sreeja
>            Priority: Major
>              Labels: pull-request-available
>
> AWS S3 PutObject API allows creating keys and directory names containing invalid characters. To prevent issues during delete operations (which fails to remove such invalid objects), add validation to check and reject invalid key and directory names at creation time.This issue with respect to deletion is seen only for FSO buckets and not in OBS buckets.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org