Add kludge setting to enable special handling of FilePath attribute #174

Closed
opened 2024-12-03 15:14:32 +00:00 by alexvanin · 0 comments
Owner

FilePath and FileName are both well-known attributes defined in API. However, some software may keep FileName attribute and ignore FilePath attribute during file upload.

Describe the solution you'd like

Add a new kludge setting (similar to s3 gateway) to enable special behaviour during get_by_attribute request with FilePath attribute.

If FilePath value contains no / symbols or single leading / symbol additionally try to search FileName attribute. Use additional FileName search, if FilePath returns no values.

Use additional search if `FilePath` search returns no values
/get_by_attribute/<cid>/FilePath/cat.jpg
/get_by_attribute/<cid>/FilePath//dog.jpg

Don't use additional search
/get_by_attribute/<cid>/FilePath//folder/dog.jpg
/get_by_attribute/<cid>/Name/cat.jpg

Describe alternatives you've considered

None

Additional context

None

## Is your feature request related to a problem? Please describe. FilePath and FileName are both well-known attributes [defined in API](https://git.frostfs.info/TrueCloudLab/frostfs-api/src/commit/8540f0d18d5d26fd32ead801478e8405b8fbaaaf/object/types.proto#L143-L145). However, some software may keep FileName attribute and ignore FilePath attribute during file upload. ## Describe the solution you'd like Add a new `kludge` setting (similar to [s3 gateway](https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/51322cccdf54e0e7bd4fd3fb0acd5553606498f1/config/config.yaml#L215)) to enable special behaviour during `get_by_attribute` request with FilePath attribute. If `FilePath` value contains **no / symbols** or **single leading / symbol** additionally try to search `FileName` attribute. Use additional `FileName` search, if `FilePath` returns no values. ``` Use additional search if `FilePath` search returns no values /get_by_attribute/<cid>/FilePath/cat.jpg /get_by_attribute/<cid>/FilePath//dog.jpg Don't use additional search /get_by_attribute/<cid>/FilePath//folder/dog.jpg /get_by_attribute/<cid>/Name/cat.jpg ``` ## Describe alternatives you've considered None ## Additional context None
alexvanin added this to the v0.32.0 milestone 2024-12-03 15:14:40 +00:00
r.loginov was assigned by alexvanin 2024-12-03 15:21:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#174
No description provided.