Skip to content

Gated artifacts (per-artifact shared-link token)#55

Open
obaid wants to merge 1 commit into
feature/artifact-appsfrom
feature/artifact-gated
Open

Gated artifacts (per-artifact shared-link token)#55
obaid wants to merge 1 commit into
feature/artifact-appsfrom
feature/artifact-gated

Conversation

@obaid

@obaid obaid commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Feature 1, PR 4 of ~5. Stacked on #54. Implements the public/gated choice per artifact.

Gated artifacts mint a 40-char access token. Caddy serves them only when ?token=<token> matches — validated locally (a query matcher baked into the site file), so there's no per-request round-trip to core and revoking is just a re-sync. The token is baked into the artifact's public_url, so the dashboard link works as-is.

Piece Detail
CaddyArtifactService Gated handle_path blocks wrap the file_server/reverse_proxy in @ok query token=<token>handle @ok { … }, falling back to respond "Forbidden" 403.
PublishArtifactService Mints access_token for gated artifacts and appends ?token= to public_url.
ArtifactController Accepts visibility=public|gated.
Dashboard Already renders the gated badge + the tokened URL (from #53).

Tests

Gated Caddy config (token matcher + 403 fallback), token minting + URL, and gated publish via the API. Full suite green (764).

Last stage next: 5) the agent publish_artifact tool + lifecycle cleanup on teardown.

Artifacts can be published public or gated. Gated artifacts mint a 40-char
access token; Caddy serves them only when ?token=<token> matches (validated
locally, so revoking is a re-sync away with no per-request round-trip). The
token is baked into the artifact's public_url so the dashboard link works.

- CaddyArtifactService: gated handle blocks wrap the file_server/reverse_proxy
  in a token query matcher, falling back to 403.
- PublishArtifactService: mints access_token for gated artifacts and appends
  ?token= to public_url.
- ArtifactController: accepts visibility=public|gated.

Full suite green.
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.

1 participant