Skip to content

feat(storage): add secured=false option for public artifact access#1436

Open
dan-kirberger wants to merge 1 commit intogo-vela:mainfrom
dan-kirberger:feat/artifact-public-access
Open

feat(storage): add secured=false option for public artifact access#1436
dan-kirberger wants to merge 1 commit intogo-vela:mainfrom
dan-kirberger:feat/artifact-public-access

Conversation

@dan-kirberger
Copy link
Copy Markdown

@dan-kirberger dan-kirberger commented Apr 10, 2026

slopped together idea for go-vela/community#1086

⚠️ This PR summary was generated by an AI language model.

Why

Adds first-class support for publicly-accessible build artifacts. Teams often need to share artifact URLs (e.g. test reports, binaries) without requiring presigned URL expiry or authentication. Previously there was no way to opt individual artifacts out of presigned-URL access.

What changed

  • New secured: false field on the artifacts block in .vela.yml. When set, uploaded objects are stored under a public/{org}/{repo}/{build}/ prefix in MinIO and returned with a direct (non-presigned) GET URL. Defaults to true (presigned, existing behaviour).
  • DirectObjectURL method added to the Storage interface and MinIO implementation to construct direct URLs from {endpoint}/{bucket}/{key}.
  • ListObjects now iterates both the standard and public/ prefixes and returns direct URLs for public objects.
  • New --storage-public-policy / VELA_STORAGE_PUBLIC_POLICY server flag that, when enabled, automatically applies an anonymous-GET bucket policy scoped to the public/* prefix on startup.
  • ?secured=false query parameter support added to the storage API upload handler.
  • Full test coverage added/updated for all changed paths; go test ./... passes clean.

Adds a `secured: false` field to the artifacts block in .vela.yml pipelines
that routes artifact objects under a `public/` prefix in MinIO, enabling
direct (non-presigned) GET URLs for unauthenticated artifact downloads.
Uploads remain worker-authenticated. Includes `--storage-public-policy`
flag to optionally auto-configure bucket policy for anonymous GET on public/*.

Co-authored-by: Dayton <31824+SVDEA001@users.noreply.git.target.com>
@dan-kirberger dan-kirberger requested a review from a team as a code owner April 10, 2026 02:40
Comment thread storage/minio/minio.go

// applyPublicPolicy sets an anonymous read-only policy on the public/* prefix of the bucket,
// allowing unauthenticated GET requests for objects stored under that prefix.
func (c *Client) applyPublicPolicy(ctx context.Context) error {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this doesn't make sense here? better applied separately as some administrative setup?

@dan-kirberger
Copy link
Copy Markdown
Author

there'd be similar PRs in worker + sdk i assume

// to a pipeline Artifact type.
func (a *Artifacts) ToPipeline() *pipeline.Artifacts {
// default secured to true when not explicitly set
secured := true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be easier for implementation/styling if the YAML is inverted here. Something like insecure or public, where the default of false is the more secure option.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er, yeah that makes way more sense - thanks! does the general "ask" here sound reasonable? i kinda flailed at a random robo-generated solution here. definitely not tied to anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants