Skip to content

Move to rypt SDK v0.2.0; localhost now needs https - #8

Merged
levidurfee merged 1 commit into
developmentfrom
fix/sdk-v0.2.0
Nov 2, 2026
Merged

levidurfee merged 1 commit into
developmentfrom
fix/sdk-v0.2.0

Conversation

@levidurfee

Copy link
Copy Markdown
Contributor

rypt SDK v0.2.0 (x6c-co/rypt#5) allows plain http 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 RYPT_API_URL=http://localhost:… is now a usage error. https://localhost still works.

Changes

  • go.mod: github.com/x6c-co/rypt v0.1.0 → v0.2.0. Only the rypt lines change in go.sum.
  • TestPlainHTTPNeverProxied checks that plain http to 127.0.0.1 and to [::1] never goes through HTTP_PROXY. The [::1] case runs on its own tcp6 server and is skipped without IPv6. The test also 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. It still covers the trailing slash, the path prefix and [::1].
  • 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.

Tests

make vet, make test and make race pass. 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

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
@levidurfee
levidurfee merged commit 063e347 into development Nov 2, 2026
3 checks passed
@levidurfee
levidurfee deleted the fix/sdk-v0.2.0 branch November 2, 2026 00:26
@levidurfee levidurfee mentioned this pull request Nov 5, 2026
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