Skip to content

feat(wind-tuic): ActiveConnections registry for per-user limits + kick#31

Merged
Itsusinn merged 2 commits into
mainfrom
feat/active-connections-kick
Jun 18, 2026
Merged

feat(wind-tuic): ActiveConnections registry for per-user limits + kick#31
Itsusinn merged 2 commits into
mainfrom
feat/active-connections-kick

Conversation

@Itsusinn

Copy link
Copy Markdown
Member

Summary

Adds an optional live-connection registry to the TUIC server core so a host binary can:

  • enforce a per-user concurrent-connection limit (ActiveConnections::count_for), and
  • actively kick a user's live connections (ActiveConnections::kick_user) — e.g. when a panel removes or rekeys a user.

How it works

  • New wind_tuic::ActiveConnections (DashMap<conn_id, (UserId, CancellationToken)>), gated behind the server feature.
  • serve_connection registers each connection after the on_authenticated veto (so a per-user limit check counts only the user's other live connections) and deregisters on close. Cancelling the stored token trips the existing shutdown path, which closes the QUIC connection.
  • Wired through both the quinn and quiche backends as an Option-defaulting field, so existing callers (e.g. the reference tuic-server) are unaffected.

Testing

  • cargo test -p wind-tuic (incl. the new active::tests::count_and_kick)
  • cargo build -p tuic-server and cargo build -p wind-tuic --features quiche both green.

🤖 Generated with Claude Code

Itsusinn and others added 2 commits June 18, 2026 14:52
… kick

Add an optional live-connection registry to the TUIC server core so a host
binary can enforce a per-user concurrent-connection limit (count_for) and
actively kick a user's live connections (kick_user) - e.g. when a panel
removes or rekeys a user. Each authenticated connection registers its
cancel token in serve_connection (after the on_authenticated veto) and
deregisters on close; cancelling the token trips the existing shutdown path
and closes the QUIC connection.

Threaded through both the quinn and quiche backends as an Option-defaulting
field, so existing callers (e.g. the reference tuic-server) are unaffected.
dashmap backs the registry, gated behind the server feature.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Itsusinn Itsusinn merged commit 7831f72 into main Jun 18, 2026
17 checks passed
@Itsusinn Itsusinn deleted the feat/active-connections-kick branch June 18, 2026 08:25
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