Gated artifacts (per-artifact shared-link token)#55
Open
obaid wants to merge 1 commit into
Open
Conversation
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.
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.
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'spublic_url, so the dashboard link works as-is.CaddyArtifactServicehandle_pathblocks wrap thefile_server/reverse_proxyin@ok query token=<token>→handle @ok { … }, falling back torespond "Forbidden" 403.PublishArtifactServiceaccess_tokenfor gated artifacts and appends?token=topublic_url.ArtifactControllervisibility=public|gated.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_artifacttool + lifecycle cleanup on teardown.