s3api storage_domain list should be sorted longest to shortest

Bug #2031335 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Undecided
Unassigned

Bug Description

If you have multiple storage domains configured and one is a subdomain of another, you get different behavior depending on the order in which you configure them. For example, with

   storage_domain = user1.cluster.domain, cluster.domain

things will work reasonably well (aside from the fact that other users won't be able to access buckets named "user1" with bucket-in-host addressing), but

   storage_domain = cluster.domain, user1.cluster.domain

*won't* work well -- when a request comes in for "bucket.user1.cluster.domain", we interpret it as a request for the bucket "bucket.user1" then reject it for having an invalid bucket name.

This is because we currently track the list of domains in the order configured by the user, then iterate through them until we find one that's a suffix of the requested domain. If we instead sort them from longest to shortest when loading the config, we'll have more consistent behavior that generally works better.

Tags: s3api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/898679

Changed in swift:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.