[#197] Add a leading slash to the FilePath attribute #209
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#209
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "r.loginov/frostfs-http-gw:feature/197-treat_filepath_attribute_with_leading_slash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
close #197
According to the frostfs api specification,
the File Path attribute must start with a
leading slash. More info:
https://git.frostfs.info/TrueCloudLab/frostfs-api
Test scenarios:
CID:
2yDhMPpQpYJEdR1aWqKdBo3SaTLTU4tQm841BWaP2HPZ
Creating an object with
FilePath=/global/cats/cat.txt
:Let's check the values of its attributes:
Executing the query without using the leading slash at the beginning of the `FilePath' attribute
Execute the query using the leading slash at the beginning of the `FilePath' attribute:
Signed-off-by: Roman Loginov r.loginov@yadro.com
@ -319,6 +318,18 @@ func (h *Handler) needSearchByFileName(key, val string) bool {
return strings.HasPrefix(val, "/") && strings.Count(val, "/") == 1 || !strings.Contains(val, "/")
}
func prepareAtribute(attrKey, attrVal string) string {
It seems in this case it will be very convenient to disable strict compliance with the specification (#207) through a parameter from the configuration. It will only be enough to add a check for the value of the new flag.
@ -322,1 +330,4 @@
return attrVal
}
func prepareFileName(fileName string) string {
I have a question here. Don't we want to check the
FileName
for the absence of slashes in general, and not just at the beginning? After all, according to the specification,FileName
should not contain slashes at all.We decided that it still needed to be done. Created a task: #215
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.