feat(routes)!: replace mountArtifacts with createArtifactRoutes - #28
Open
TheGreatAxios wants to merge 2 commits into
Conversation
TheGreatAxios
commented
Sep 25, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed both commits, one fresh review plus three re-reviews. The factory has the same shape as createGrantRoutes, and both create routes gate on artifact:* create before reading the body. Revise and archive keep their per-artifact grants. No references to mountArtifacts remain outside the CHANGELOG. The new test drives the real grant evaluator and checks that a refusal writes nothing. Two findings were waived by Greybeard, as described in the PR body.
TheGreatAxios
force-pushed
the
cl-9053-artifacts-replace-mountartifacts-with
branch
from
September 25, 2026 14:30
1a0aa08 to
211fd94
Compare
mountArtifacts registered routes on the host's app. createArtifactRoutes builds and returns its own Hono<TenantEnv> sub-app instead, the shape Interchange's hub-api uses for createGrantRoutes, and the host mounts it with app.route. The dependencies and the routes themselves are unchanged; mountArtifacts is removed with no alias.
TheGreatAxios
force-pushed
the
cl-9053-artifacts-replace-mountartifacts-with
branch
from
September 26, 2026 01:29
211fd94 to
989f2ca
Compare
POST /artifacts and POST /artifacts/upload only checked for a principal, so any signed-in caller could create. They now run requireGrant with create on artifact:*, the way hub-api's createGrantRoutes gates creating a grant on grant:*, after the principal check and before the body is read. The reference host seeds that grant for its tenant's principals.
TheGreatAxios
force-pushed
the
cl-9053-artifacts-replace-mountartifacts-with
branch
from
September 26, 2026 01:37
989f2ca to
9a23cd1
Compare
TheGreatAxios
added this pull request to stack #32
September 26, 2026 01:57
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
createArtifactRoutes(deps): Hono<TenantEnv>builds its own sub-app the way hub-api'screateGrantRoutesdoes, and the host mounts it withapp.route.mountArtifactsandMountArtifactsOptsare removed with no alias. The deps type is nowCreateArtifactRoutesDeps.POST /artifactsandPOST /artifacts/uploadrunprincipalRequiredand thenrequireGrant("artifact:*", "create")before reading the body. This matches hub-api gating grant creation ongrant:*. Revise and archive still require per-artifact grants.artifact:*/createfor the principals it creates.mountWorkflowArtifactsis unchanged here; fix(uploads): store upload bytes per version #31 converts it. The mail-attachment routes still need only a principal, the README says so, and refactor!: remove skill-draft, web_site handling and mail attachments #30 removes them.mount.test.tspasses the factory's no-op defaults explicitly, sinceexactOptionalPropertyTypesrules out passingundefinedwithout a spread. The create handlers keep the file's existing unreachable null-scope guard afterprincipalRequired.Verification
createRequireGrant: with the create grant it returns 201, without it 403, and nothing is written on a refusalCloses CL-9053