Repository navigation
Serve the sandbox Link at /api/v1/sandbox-link - #505
Merged
Merged
Conversation
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.
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.
C6 PR3a: the relay that
cmd/serveralready builds is now served atGET /api/v1/sandbox-link(WebSocket upgrade). There is no route credential: each peer authenticates in its Link Hello.Link URL.
placement.LinkURLderives it from the existing public URL, with no new setting:httpsgiveswss://<origin>/api/v1/sandbox-link;httporigin givesws://;ErrNoLink.The rule is documented in
docs/configuration.md(+ zh).Route.
runtime.openapi.yaml, andmachine-api.md(+ zh).Hijackpassthrough on the router's response wrapper, so the upgrade works behind the middleware.Tests.
TestLinkURLis the table test for the rule.Local checks:
make openapileaves no diff;make check-openapiandmake check-sqlcpass.go testpasses for api, placement, cmd/server and sandbox/providers, plus the integration tests.-race -count=50on the TestLinkAuthority tests passes.make check-names check-docs check-cipass, and the translation test passes.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.