Repository navigation
Conversation
…IPv6 and max port
ForwardSpec::parse already handles a pre-bracketed IPv6 bind address
("[::1]:8080") by splitting on the last ':' and retaining the brackets in
bind_addr, but this code path had no test. A user can reasonably supply
the bracketed form (it mirrors what OpenSSH itself uses in '-L' arguments),
so the behaviour deserves explicit documentation via tests.
Also adds a boundary test for port 65535 (the highest valid u16 value),
which was not covered by the existing parse tests.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
|
Thank you for your interest in contributing to OpenShell, @0x5t4l1n. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
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
ForwardSpec::parseaccepts a pre-bracketed IPv6 bind address(
[::1]:8080) — it splits on the last:, retains the brackets inbind_addr, andssh_forward_arg/Displayboth round-trip correctly.However this code path was untested, so a refactor could silently break it.
Also adds a boundary test for port
65535(the highest validu16value),which was not covered by the existing
forward_spec_parse_rejects_zero_portand
forward_spec_parse_rejects_invalidtests.New tests
forward_spec_parse_bracketed_ipv6_and_port"[::1]:8080"parses correctly;ssh_forward_argdoes not double-bracket;Displayround-tripsforward_spec_parse_max_port_boundary65535accepted for both plain-port andaddr:portformsTest plan
cargo test -p openshell-core forward_spec_parse— new tests passcargo test -p openshell-core— no regressions🤖 Generated with Claude Code