Skip to content

Remove pairing code verification of paired clients - #466

Merged
maximmaxim345 merged 1 commit into
mainfrom
feat/remove-pairing-verify
Oct 2, 2026
Merged

maximmaxim345 merged 1 commit into
mainfrom
feat/remove-pairing-verify

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

What does this implement/fix?

Removes PairingAttempt.verify and the verify parameter of run_static_pairing_code_server and run_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 unauthorized when a server sends ['pairing'] on a long-term PSK, as the spec requires.

Related issue or spec PR (if applicable):

Types of changes

  • 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

@maximmaxim345
maximmaxim345 requested a balanced review from Copilot October 2, 2026 06:30
@github-actions github-actions Bot added the breaking-change Changes the public API or the protocol in a way that is not backwards compatible label Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 verify pairing 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.

@maximmaxim345
maximmaxim345 merged commit a7d1536 into main Oct 2, 2026
4 checks passed
@maximmaxim345
maximmaxim345 deleted the feat/remove-pairing-verify branch October 2, 2026 06:35
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes the public API or the protocol in a way that is not backwards compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants