174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 #204

Open
r.loginov wants to merge 2 commits from r.loginov/frostfs-http-gw:feature/174-add_slash_clipping_when_search_by_filename_attr into support/v0.32
Member

According to the FrostFS API specification,
the FileName attribute cannot contain a slash
at the beginning.

Test scenarios:

Container CID: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW

Test scenario 1

Getting an object by the attribute FileName'. The value of the FileName` attribute has a "/" at the beginning.

Uploading an object:
# frostfs-cli object put -c cli.yml --cid 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW --file cat.jpg
 14396 / 14396 [==================================================================================================================================================================] 100.00% 0s
[cat.jpg] Object successfully stored
  OID: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq
  CID: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW

By default, its attribute is FileName=cat.jpg :
# frostfs-cli object head -c cli.yml --cid 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW --oid Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq
...
Attributes:
  FileName=cat.jpg
  Timestamp=1738665794 (2025-02-04 10:43:14 +0000 UTC)
...
We are trying to get an object using "/" at the beginning of the value of the attribute FileName:
# curl -i http://localhost:8888/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FileName//cat.jpg
HTTP/1.1 200 OK
Date: Tue, 04 Feb 2025 10:46:50 GMT
Content-Type: image/jpeg
Content-Length: 14396
X-Object-Id: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq
X-Owner-Id: NbToQ8qdTJERydwfsmt7AcPXi4xEpntZ2x
X-Container-Id: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW
X-Attribute-FileName: cat.jpg
X-Attribute-Timestamp: 1738665794
Last-Modified: Tue, 04 Feb 2025 10:43:14 GMT
Content-Disposition: inline; filename=cat.jpg
Access-Control-Max-Age: 600
Logs of the frostfs-http-gw service:
2025-02-04T10:46:50.820Z        info        request        {"id": 85899345921, "remote": "127.0.0.1:51004", "method": "GET", "path": "/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FileName/cat.jpg", "query": ""}

Test scenario 2

We are retrieving an object using the FilePath attribute that does not exist. The value of the File Path attribute has a "/" at the beginning. Due to the fact that there is no such attribute, the gate will do a fallback search using the FileName attribute.

We are trying to get an object using the "/" at the beginning of the value of the "FilePath" attribute. (The bucket and the object from the previous test scenario):
# curl -i http://localhost:8888/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FilePath//cat.jpg
HTTP/1.1 200 OK
Date: Tue, 04 Feb 2025 10:52:38 GMT
Content-Type: image/jpeg
Content-Length: 14396
X-Object-Id: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq
X-Owner-Id: NbToQ8qdTJERydwfsmt7AcPXi4xEpntZ2x
X-Container-Id: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW
X-Attribute-FileName: cat.jpg
X-Attribute-Timestamp: 1738665794
Last-Modified: Tue, 04 Feb 2025 10:43:14 GMT
Content-Disposition: inline; filename=cat.jpg
Access-Control-Max-Age: 600
Logs of the frostfs-http-gw service:
2025-02-04T10:52:38.881Z        info        request        {"id": 90194313217, "remote": "127.0.0.1:41800", "method": "GET", "path": "/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FilePath/cat.jpg", "query": ""}
2025-02-04T10:52:38.900Z        debug        object not found by filePath attribute, try search by fileName        {"id": 90194313217, "cid": "3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW", "attr_key": "FilePath", "attr_val": "/cat.jpg"}

Signed-off-by: Roman Loginov r.loginov@yadro.com

According to the FrostFS API specification, the FileName attribute cannot contain a slash at the beginning. Test scenarios: Container CID: `3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW` ### Test scenario 1 Getting an object by the attribute `FileName'. The value of the `FileName` attribute has a "/" at the beginning. ##### Uploading an object: ``` # frostfs-cli object put -c cli.yml --cid 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW --file cat.jpg 14396 / 14396 [==================================================================================================================================================================] 100.00% 0s [cat.jpg] Object successfully stored OID: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq CID: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW ``` ##### By default, its attribute is `FileName=cat.jpg `: ``` # frostfs-cli object head -c cli.yml --cid 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW --oid Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq ... Attributes: FileName=cat.jpg Timestamp=1738665794 (2025-02-04 10:43:14 +0000 UTC) ... ``` ##### We are trying to get an object using "/" at the beginning of the value of the attribute `FileName`: ``` # curl -i http://localhost:8888/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FileName//cat.jpg HTTP/1.1 200 OK Date: Tue, 04 Feb 2025 10:46:50 GMT Content-Type: image/jpeg Content-Length: 14396 X-Object-Id: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq X-Owner-Id: NbToQ8qdTJERydwfsmt7AcPXi4xEpntZ2x X-Container-Id: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW X-Attribute-FileName: cat.jpg X-Attribute-Timestamp: 1738665794 Last-Modified: Tue, 04 Feb 2025 10:43:14 GMT Content-Disposition: inline; filename=cat.jpg Access-Control-Max-Age: 600 ``` ##### Logs of the frostfs-http-gw service: ``` 2025-02-04T10:46:50.820Z info request {"id": 85899345921, "remote": "127.0.0.1:51004", "method": "GET", "path": "/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FileName/cat.jpg", "query": ""} ``` ### Test scenario 2 We are retrieving an object using the `FilePath` attribute that does not exist. The value of the `File Path` attribute has a "/" at the beginning. Due to the fact that there is no such attribute, the gate will do a fallback search using the `FileName` attribute. ##### We are trying to get an object using the "/" at the beginning of the value of the "FilePath" attribute. (The bucket and the object from the previous test scenario): ``` # curl -i http://localhost:8888/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FilePath//cat.jpg HTTP/1.1 200 OK Date: Tue, 04 Feb 2025 10:52:38 GMT Content-Type: image/jpeg Content-Length: 14396 X-Object-Id: Hn9cVfXh6yMD41W9n4KhQ4UyYHQ1a2iCa4HGSyMvr3nq X-Owner-Id: NbToQ8qdTJERydwfsmt7AcPXi4xEpntZ2x X-Container-Id: 3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW X-Attribute-FileName: cat.jpg X-Attribute-Timestamp: 1738665794 Last-Modified: Tue, 04 Feb 2025 10:43:14 GMT Content-Disposition: inline; filename=cat.jpg Access-Control-Max-Age: 600 ``` ##### Logs of the frostfs-http-gw service: ``` 2025-02-04T10:52:38.881Z info request {"id": 90194313217, "remote": "127.0.0.1:41800", "method": "GET", "path": "/get_by_attribute/3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW/FilePath/cat.jpg", "query": ""} 2025-02-04T10:52:38.900Z debug object not found by filePath attribute, try search by fileName {"id": 90194313217, "cid": "3TK3yYFQ9FqK9vGz5wfKpDS6KB81DYz8i3PinQiGLypW", "attr_key": "FilePath", "attr_val": "/cat.jpg"} ``` Signed-off-by: Roman Loginov <r.loginov@yadro.com>
r.loginov self-assigned this 2025-02-04 10:15:22 +00:00
r.loginov added 2 commits 2025-02-04 10:15:22 +00:00
According to the FrostFS API specification,
the FileName attribute cannot contain a slash
at the beginning.

Signed-off-by: Roman Loginov <r.loginov@yadro.com>
Release v0.32.3
All checks were successful
/ DCO (pull_request) Successful in 37s
/ Vulncheck (pull_request) Successful in 48s
/ Builds (pull_request) Successful in 57s
/ Lint (pull_request) Successful in 2m5s
/ Tests (pull_request) Successful in 58s
e6b210288e
Signed-off-by: Roman Loginov <r.loginov@yadro.com>
requested reviews from storage-services-developers, storage-services-committers 2025-02-04 10:15:22 +00:00
r.loginov changed title from feature/174-add_slash_clipping_when_search_by_filename_attr to 174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 2025-02-04 10:17:14 +00:00
r.loginov changed title from 174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 to WIP: 174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 2025-02-04 10:36:49 +00:00
r.loginov changed title from WIP: 174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 to 174-add_slash_clipping_when_search_by_filename_attr_support_v0.32 2025-02-04 11:12:56 +00:00
mbiryukova approved these changes 2025-02-05 10:09:24 +00:00
Dismissed
r.loginov force-pushed feature/174-add_slash_clipping_when_search_by_filename_attr from e6b210288e to 9f80b4f2ad 2025-02-05 11:06:21 +00:00 Compare
r.loginov dismissed mbiryukova's review 2025-02-05 11:06:22 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

All checks were successful
/ DCO (pull_request) Successful in 34s
/ Vulncheck (pull_request) Successful in 44s
/ Builds (pull_request) Successful in 54s
/ Lint (pull_request) Successful in 2m1s
/ Tests (pull_request) Successful in 54s
This pull request doesn't have enough approvals yet. 0 of 2 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/174-add_slash_clipping_when_search_by_filename_attr:r.loginov-feature/174-add_slash_clipping_when_search_by_filename_attr
git checkout r.loginov-feature/174-add_slash_clipping_when_search_by_filename_attr
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-committers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-http-gw#204
No description provided.