Add option to disable pre-signed S3 URLs for artifact browsing#781
Open
mikenau wants to merge 3 commits intojenkinsci:masterfrom
Open
Add option to disable pre-signed S3 URLs for artifact browsing#781mikenau wants to merge 3 commits intojenkinsci:masterfrom
mikenau wants to merge 3 commits intojenkinsci:masterfrom
Conversation
…ccessing the s3 content.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When artifacts are accessed through Jenkins, this plugin redirects the browser to a pre-signed S3 URL. This breaks HTML reports that use relative links (e.g.
<a href="page2.html">), because the browser resolves those links against the S3 URL rather than the Jenkins URL. We archive a large number of playwright reports and the trace files do not load properly when using a pre-signed S3 URL.This PR adds a new
Disable Presigned URLsconfiguration option. When enabled,JCloudsVirtualFile.toExternalURL()returnsnull, which tells Jenkins core to stream artifact content through the controller instead of redirecting to S3. This preserves relative links for HTML reports. Upload and stash/unstash operations are not affected.Changes
BlobStoreProvider: AddedisDisablePresignedUrls()with a default offalseso existing providers are unaffectedS3BlobStoreConfig: AddeddisablePresignedUrlsboolean field with@DataBoundSetter, following the same pattern as existing optionsS3BlobStore: OverridesisDisablePresignedUrls()to delegate toS3BlobStoreConfigJCloudsVirtualFile:toExternalURL()returnsnullwhen the option is enabled, causing Jenkins to proxy the artifactdisablePresignedUrls: trueunderaws.s3Configuration
Jenkins UI: Manage Jenkins > Amazon Web Services Configuration > "Disable Presigned URLs" checkbox
Configuration as Code:
Trade-offs
When enabled, all artifact downloads are proxied through the Jenkins controller, which increases controller load. This is acceptable for use cases where HTML report navigation is required.
Testing