"The middleware inserts the account name into the URL, converts the "wikipedia/commons" section into a Swift container name by replacing slash with %2F, adds "%2Fthumb" or "%2Farchived" or "%2Fdeleted" to the container name and adds the rest of the hashing and filename as the object name"
To be clear their is the cloudfiles interface and the rewrite.py script in the WSGI stack. This is about the later.
"archived" should not be added to the container name (and actually isn't in the code). On the other hand, "temp" and "public" should.
Examples of how rewrites should happen (ignoring container sharding):
Original URL: upload.wikimedia.org/site/lang/a/ab/file.jpg
Swift URL: site-lang-images-public/a/ab/file.jpg
Original URL: upload.wikimedia.org/site/lang/thumb/a/ab/file.jpg/120px-file.jpg
Swift URL: site-lang-images-thumb/a/ab/file.jpg/120px-file.jpg
Original URL: upload.wikimedia.org/site/lang/thumb/archive/a/ab/file.jpg/120px-file.jpg
Swift URL: site-lang-images-thumb/archive/a/ab/file.jpg/120px-file.jpg
Original URL: upload.wikimedia.org/site/lang/temp/a/ab/file.jpg/120px-file.jpg
Swift URL: site-lang-images-temp/a/ab/file.jpg/120px-file.jpg
The above would be consistent with FileRepo/FileBackend.