Repository navigation
Remove pairing code verification of paired clients - #466
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the linked specification and includes comprehensive coverage for the changed behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Updates pairing behavior to match Sendspin spec PR #192 by removing verification-only pairing and requiring code pairing over Sentinel.
Changes:
- Removes the
verifypairing APIs and logic. - Rejects pairing activity over long-term PSKs.
- Updates pairing and activation tests for re-pairing behavior.
| File | Description |
|---|---|
aiosendspin/client/connection.py |
Rejects pairing activity on long-term PSKs. |
aiosendspin/noise/pairing.py |
Removes verification-only pairing paths. |
aiosendspin/server/connection.py |
Re-handshakes code pairing onto Sentinel. |
tests/client/test_server_state.py |
Updates role-state activation cases. |
tests/client/test_stream_role_removal.py |
Updates stream-role removal cases. |
tests/integration/test_noise_pairing_flow.py |
Replaces verification scenarios with re-pairing coverage. |
tests/noise/test_pairing.py |
Updates pairing finalization tests. |
tests/test_client_protocol_callbacks.py |
Verifies revised PSK activity admission. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 of 9 tasks
maximmaxim345
added a commit
that referenced
this pull request
Oct 5, 2026
# What does this implement/fix? <!-- Quick description and explanation of changes. --> Cancelling or failing a pairing attempt on an already paired client left it without playback until it reconnected. The attempt moves the connection off the client's long-term PSK, and nothing moved it back. Now the server re-handshakes back onto the stored long-term PSK after the leave `server/activate`, restoring playback and roles on the same connection. If that re-handshake fails, the server closes the connection so the client reconnects. **Related issue or spec PR (if applicable):** - #466 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the matching label, and the release notes use it to sort this change. --> - [x] Bugfix (non-breaking change which fixes an issue): `bugfix` - [ ] New feature (non-breaking change which adds functionality): `new-feature` - [ ] Enhancement to an existing feature: `enhancement` - [ ] Breaking change (changes the public API or the protocol in a way that is not backwards compatible): `breaking-change` - [ ] Refactor (no behavior change): `refactor` - [ ] Documentation only: `documentation` - [ ] Maintenance / chore: `maintenance` - [ ] CI / workflow change: `ci` - [ ] Dependencies bump: `dependencies`
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.
What does this implement/fix?
Removes
PairingAttempt.verifyand theverifyparameter ofrun_static_pairing_code_serverandrun_dynamic_pairing_code_server, since the spec no longer allows code pairing over a long-term PSK and dropped device presence verification with it.A pairing code attempt on a paired client now always re-pairs over the Sentinel PSK. The client library now closes the connection with
unauthorizedwhen a server sends['pairing']on a long-term PSK, as the spec requires.Related issue or spec PR (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies