10 Commits

Author SHA1 Message Date
Tim Burke
8c4e65a6b5 staticweb: Work with prefix-based tempurls
Note that there's a bit of a privilege escalation as prefix-based
tempurls can now be used to perform listings -- but only on containers
with staticweb enabled. Since having staticweb enabled was previously
pretty useless unless the container was both public and
publicly-listable, I think it's probably fine.

This also allows tempurls to be used at the container level, but only
for staticweb responses.

Change-Id: I7949185fdd3b64b882df01d54a8bc158ce2d7032
2024-02-05 15:13:12 -08:00
Tim Burke
d022781bc6 s3api: Transfer REMOTE_USER when using s3_acl
Some middlewares (notably staticweb) use the absence of a REMOTE_USER to
determine that a request was unauthenticated and as a result should be
handled differently. This could cause problems for S3 requests that
were authenticated via s3api's custom auth logic, including

* server errors when a container listing request gets handled by
  staticweb or
* losing storage policy information because staticweb copied the request
  environment.

Change-Id: Idf29c6866fec7b413c4369dce13c4788666c0934
Closes-Bug: #1833287
Related-Change: I5fe5ab31d6b2d9f7b6ecb3bfa246433a78e54808
2021-01-08 16:11:02 -08:00
Tim Burke
ba46eb0e3d py3: Fix non-ascii chars in staticweb listings
Change-Id: Ifcf810f009a8036f250a09eec0d9a65a77342129
Closes-Bug: #1894357
2020-09-06 22:04:06 -07:00
Sean McGinnis
5b26b749b5
Drop use of unittest2
unittest2 was needed for Python version <= 2.6, so it hasn't been needed
for quite some time. See unittest2 note one:

https://docs.python.org/2.7/library/unittest.html

This drops unittest2 in favor of the standard unittest module.

Change-Id: I2e787cfbf1709b7f9c889230a10c03689e032957
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-12 03:13:41 -06:00
Tim Burke
9d1b749740 py3: port staticweb and domain_remap func tests
Drive-by: Tighten domain_remap assertions on listings, which required
that we fix proxy pipeline placement. Add a note about it to the sample
config.

Change-Id: I41835148051294088a2c0fb4ed4e7a7b61273e5f
2019-07-10 09:51:38 -07:00
Tim Burke
e5ff405ec9 Make staticweb return URL-encoded Location headers
Also, enhance tests to verify proper encoding in generated responses.

Change-Id: Ib696b1c3a34722f3a6de010973b90ef8b1917012
Partial-Bug: 1774238
2019-04-12 12:29:00 -07:00
Tim Burke
8e892713ee Tighten up staticweb redirect test
Change-Id: Ifc3f2f58f51c71f4e652567b4f9c82deb98bbb5b
2018-06-15 10:32:05 -07:00
Tim Burke
b39a88ca65 func tests: Rename storage_url to storage_path
... so we can use storage_url for actual, complete URLs.
Also, expose storage_scheme for easier comparisons.

Change-Id: Iffcfc327bc674681ac51fe75c1d9911fa3a60d54
2018-06-15 10:32:05 -07:00
Alistair Coles
8b44c9df29 Allow domain remap storage_domain to be configured for func tests
Previously some tests in /test/functional/test_staticweb.py assumed
that domain_remap middleware was configured with the default
storage_domain 'example.com'. As a result those tests would fail if
run against a cluster with domain_remap middleware installed but not
having an 'example.com' storage_domain.

This patch allows a storage_domain to be configured in the test.conf
file so that the tests may be successfully run against any cluster. If
the option is not set then the tests will be skipped.

To ensure that the in process test job func-domain-remap-staticweb
still runs all the tests in test_staticweb.py, its config loader is
modified to add the required storage_domain option to the test config
with the same value used by the domain_remap middleware.

Related-Change: I6bc70039c1b99b8a5bf5a30e9c6877d4f0aa638d
Co-Authored-By: Tim Burke <tim.burke@gmail.com>

Change-Id: Ifab84fc3ef66b9790e96ebb8e5c8061a12636045
2018-06-07 11:59:08 +01:00
Romain LE DISEZ
335899f89f Functional tests for staticweb middleware
Change-Id: I6bc70039c1b99b8a5bf5a30e9c6877d4f0aa638d
2018-03-07 12:36:20 -08:00