Skip to content

feat(banner): add API for userauth banner fetching#500

Merged
kruton merged 1 commit into
connectbot:mainfrom
kruton:tailscale-callback
May 30, 2026
Merged

feat(banner): add API for userauth banner fetching#500
kruton merged 1 commit into
connectbot:mainfrom
kruton:tailscale-callback

Conversation

@kruton
Copy link
Copy Markdown
Member

@kruton kruton commented May 30, 2026

Tailscale uses a banner message during "none" authentication to provide a URL to click on. Add a way for clients to fetch it.

Copilot AI review requested due to automatic review settings May 30, 2026 06:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a public callback API to surface SSH SSH_MSG_USERAUTH_BANNER messages to clients (e.g., to display “none” auth login URLs like Tailscale’s) and wires delivery through the connection/authentication stack.

Changes:

  • Introduces UserAuthBannerCallback and Connection.addUserAuthBanner/removeUserAuthBanner for clients to register banner listeners.
  • Plumbs banner callbacks into AuthenticationManager and TransportManager so banners are delivered both during authentication and when no message handler is registered.
  • Adds JUnit tests covering banner packet parsing and callback notification/exception handling.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/java/com/trilead/ssh2/packets/PacketUserauthBannerTest.java Adds test coverage for banner packet language parsing/round-trip.
src/test/java/com/trilead/ssh2/auth/AuthenticationManagerBannerTest.java Adds tests ensuring banner callbacks are notified (and exceptions are ignored) during none auth.
src/main/java/com/trilead/ssh2/UserAuthBannerCallback.java New public callback interface for receiving auth banners.
src/main/java/com/trilead/ssh2/transport/TransportManager.java Adds storage/dispatch for banner callbacks and intercepts unhandled banner packets in the receive loop.
src/main/java/com/trilead/ssh2/packets/PacketUserauthBanner.java Exposes banner language via a new getter.
src/main/java/com/trilead/ssh2/Connection.java Adds connection-level registration/removal API and passes callbacks into transport/auth layers.
src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java Accepts banner callback list and notifies callbacks when banner packets are received.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/trilead/ssh2/transport/TransportManager.java
@kruton kruton force-pushed the tailscale-callback branch from ab13967 to b08011d Compare May 30, 2026 06:37
Tailscale uses a banner message during "none" authentication to provide a URL
to click on. Add a way for clients to fetch it.
@kruton kruton force-pushed the tailscale-callback branch from b08011d to 96eae22 Compare May 30, 2026 06:40
@sonarqubecloud
Copy link
Copy Markdown

@kruton kruton enabled auto-merge (rebase) May 30, 2026 06:41
@kruton kruton merged commit c3ec5ef into connectbot:main May 30, 2026
6 checks passed
@kruton kruton deleted the tailscale-callback branch May 30, 2026 06:43
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.

2 participants