Comment 24 for bug 1449212

Revision history for this message
Samuel Merritt (torgomatic) wrote :

Going in no particular order:

If an account and container share a key, then the bigger scope should apply. That'll cause the minimum confusion. I'll fix it.

I will also put more words about the swift.infocache thing in the commit message.

I will attempt to write a functional test as well.

We don't need to strip anything on tempurl PUT. Now that the authorize callback isn't getting stepped on, you can't use a container tempurl to GET a manifest with segments in another container, so there's no problem letting the user make one.

I'd like to, someday, make all that get_info stuff a little more sane. The fact that it relies on this key existing in the response's environment dictionary to get account or container info is pretty damn strange, and it causes all sorts of problems if you ever want to use a modified response without changing what the caller sent you. This fix makes it a little better in that you can shallow-copy the WSGI environment without breaking get_info()'s caching and basic functionality. The real fix is probably to make get_info() look at the response headers for account/container info instead of grubbing around in the response environment.

I'm not a fan of adding to the COPY-check for a couple reasons. First, swift.authorize_override is really just an instruction to auth systems that says someone else is stepping in to handle auth so please don't fail this request. Overloading that in the proxy seems like a hack that works for tempurl, but only coincidentally. Second, since Thiago is working on moving COPY to middleware, we'll be able to get rid of that workaround for COPY too, and just always pop out swift.authorize if it has already authorized the request.

Besides, moving all that stuff to swift.infocache can help out the cacheability of stuff. Right now, if a middleware makes a subrequest and shallow-copies the environment to do so, any get_*_info done on that subrequest doesn't get cached later since it only appears in the copied env. By moving all that stuff into swift.infocache, the get_*_info calls will get their results cached.