Add helpers to s3 client for image upload delete and list
What does this MR do?
As part of #205166 (closed), I need to delete all s3 objects at a specific key prefix in order to 'unpublished' an incident on the status_page.
I also need to list all objects at a specific key prefix in order to be efficient about not publishing uploads that are already published. For this piece, I added a helper that gets a set of all objects at a given prefix. I paginate through the object list and used a Set to store keys for efficient look up. The size of the set is at least bounded by the number of comments allowed and the 1MB size limit on comment/description fields but perhaps we should also introduce a limit here on # of images we will send to the status page. I'm not sure if there is a limit to # of uploads allowed per field but it does not appear to be documented in Application Limits.
For more context on how I will use these methods see this MR: !28052 (diffs).
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team