Skip to content

Serve the sandbox Link at /api/v1/sandbox-link - #505

Merged
SaladDay merged 1 commit into
aos/cutoverfrom
aos/sandbox-serve-a
Oct 7, 2026
Merged

SaladDay merged 1 commit into
aos/cutoverfrom
aos/sandbox-serve-a

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

C6 PR3a: the relay that cmd/server already builds is now served at GET /api/v1/sandbox-link (WebSocket upgrade). There is no route credential: each peer authenticates in its Link Hello.

  • Link URL. placement.LinkURL derives it from the existing public URL, with no new setting:

    • https gives wss://<origin>/api/v1/sandbox-link;
    • a loopback http origin gives ws://;
    • any other origin returns ErrNoLink.

    The rule is documented in docs/configuration.md (+ zh).

  • Route.

    • Route annotations, regenerated runtime.openapi.yaml, and machine-api.md (+ zh).
    • An explicit HEAD 405.
    • A Hijack passthrough on the router's response wrapper, so the upgrade works behind the middleware.
  • Tests.

    • All six TestLinkAuthority integration tests now Serve and Attach through the real route.
    • TestLinkURL is the table test for the rule.

Local checks:

  • make openapi leaves no diff; make check-openapi and make check-sqlc pass.
  • Focused go test passes for api, placement, cmd/server and sandbox/providers, plus the integration tests.
  • -race -count=50 on the TestLinkAuthority tests passes.
  • make check-names check-docs check-ci pass, and the translation test passes.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Mount the Link relay that cmd/server builds in the API router as a
WebSocket upgrade with no route credential: each peer authenticates in its
Link Hello. The response writer passes Hijack through so the upgrade works
behind the router middleware.

placement.LinkURL derives the Link URL from OAC_PUBLIC_URL: wss for an
https origin, loopback ws for a loopback http origin, and ErrNoLink for any
other origin. The Link Authority integration tests now dial the real route
at the derived URL.
@SaladDay
SaladDay merged commit d4db18e into aos/cutover Oct 7, 2026
@SaladDay
SaladDay deleted the aos/sandbox-serve-a branch October 7, 2026 17:01
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