* Always return Last-Modified and support If-Modified-Since.
* IMGPROXY_USE_LAST_MODIFIED config setting.
IMGPROXY_USE_LAST_MODIFIED (default false) when enabled will return the
Last-Modified time of the upstream image and also allow the support of
the If-Modified-Since request header (returning a 304 if the image
hasn't been modified).
If-Modified-Since allows If-None-Match to take precedence.
* Fixes based on DarthSim's feedback.
1. Don't worry about nil maps.
2. Fix a test now that we use the config.LastModifiedEnabled (and move
it's location it he test file to a more sane place).
3. Update GCS transport code based on the refactoring of DarthSim.
In this iteration, we pull the Updated time from the GCS object attributes
and format them as a string. We then parse it in the notmodified module.
Seems a bit silly to do it this way. If we agree on the approach here,
then AWS and Azure can follow.
* Support azure, fs, s3, and swift.
* Grab the headers for If-Modified-Since and Last-Modified before parsing them.
* Add tests for last-modified for fs.
* Support Last-Modified being passed when streaming an upstream file.
* Tests for Last-Modified for GCS and Azure
* Support s3 and swift tests. Sadly fakes3 doesn't support Last-Modified
* Test against forked gofakes3
* refactor: implement support for azure managed identities and service principals
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* task: implement ranged request support
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: check result.ETag for nil
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: implement null guards for content-length and content-type
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: use blockblob.CountToEnd instead of -1 for length
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* Replace OTel AWS ECS detector with fixed fork
* Update semconv in OTel
* refactor: implement support for azure managed identities and service principals
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* task: implement ranged request support
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: check result.ETag for nil
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: implement null guards for content-length and content-type
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: use blockblob.CountToEnd instead of -1 for length
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* chore: run go mod tidy
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
* refactor: discard err returns
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
Co-authored-by: DarthSim <darthsim@gmail.com>
* Add OpenStack Swift support
* Fix linting errors
* Update CHANGELOG
* Update swift documentation
* Fix linting error
* Swift transport: pass req.Context down, fix parseObjectURL() implementation
* Make swift transport test a test suite
* Use swift://{container}/{object_path} as the source image URL format
* Cleanup
* Swift transport: only close object when returning 304