Repository navigation
Move to rypt SDK v0.2.0; localhost now needs https - #8
Merged
Merged
Conversation
rypt v0.2.0 allows plain http in WithBaseURL only when the host is exactly 127.0.0.1 or ::1, and refuses the name localhost: a name is looked up, and DNS (search domains first) could send the token to another machine. rypt passes RYPT_API_URL straight to the SDK, so http://localhost is now a usage error, and https://localhost still works. TestPlainHTTPNeverProxied now checks plain http to 127.0.0.1 and to [::1] (on its own tcp6 server, skipped without IPv6) without the proxy, and checks that http://localhost and http://LOCALHOST exit with a usage error and send nothing. TestAPIURL uses 127.0.0.1 instead of swapping in localhost, and TestUsageErrors gets a row for http://localhost. The README and scripts/probe.go describe the new rule; probe.go drops the host lowercasing that only mattered for localhost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NYjhaGCRVp9GXLUuUZv8g1
Merged
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.
rypt SDK v0.2.0 (x6c-co/rypt#5) allows plain
httponly when the host is exactly127.0.0.1or::1, and refuses the namelocalhost. A name is looked up, and DNS (search domains first) could send the token to another machine. rypt passesRYPT_API_URLstraight to the SDK, soRYPT_API_URL=http://localhost:…is now a usage error.https://localhoststill works.Changes
go.mod:github.com/x6c-co/ryptv0.1.0 → v0.2.0. Only the rypt lines change ingo.sum.TestPlainHTTPNeverProxiedchecks that plainhttpto127.0.0.1and to[::1]never goes throughHTTP_PROXY. The[::1]case runs on its own tcp6 server and is skipped without IPv6. The test also checks thathttp://localhostandhttp://LOCALHOSTexit with a usage error and send nothing.TestAPIURLuses127.0.0.1instead of swapping inlocalhost. It still covers the trailing slash, the path prefix and[::1].TestUsageErrorsgets a row forhttp://localhost.scripts/probe.godescribe the new rule.probe.godrops the host lowercasing that only mattered forlocalhost.Tests
make vet,make testandmake racepass. The changed tests passed 3 runs in a row, with and without-race. A second agent reviewed the diff and found no problems.🤖 Generated with Claude Code
https://claude.ai/code/session_01NYjhaGCRVp9GXLUuUZv8g1