Skip to content

Allow at most one pairing-code method per client - #189

Merged
maximmaxim345 merged 5 commits into
Sendspin:mainfrom
balloobbot:one-pairing-code-method
Sep 2, 2026
Merged

maximmaxim345 merged 5 commits into
Sendspin:mainfrom
balloobbot:one-pairing-code-method

Conversation

@balloobbot

@balloobbot balloobbot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #184. Fixes #186.

Two changes to pairing.md's Methods section:

  • Clients may implement at most one pairing-code method: static or dynamic, not both (Pairing PSK stays mandatory). No wire change - supported_pair_methods already carries whatever the client offers; this constrains what may appear there.
  • The steering paragraph (SHOULD implement dynamic_pairing_code given an out-channel, SHOULD offer qr_code given a display) is changed to a regular non binding "should". Method choice is the client's decision; the method list already describes the trade-offs (out-channel requirement, static-code MITM caveat).

Note: overlaps textually with #183, which edits the same paragraph - whichever lands second needs a trivial rebase.

Comment thread pairing.md Resolved
Comment thread pairing.md Resolved
Comment thread pairing.md Resolved
@balloobbot
balloobbot force-pushed the one-pairing-code-method branch from bb595ca to 4e38135 Compare August 28, 2026 20:57
Comment thread pairing.md Resolved
balloob and others added 4 commits September 2, 2026 15:13
Which pairing method a client implements is its own decision, so the steering paragraph goes; the method descriptions already carry the trade-offs. A client offers static or dynamic, not both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Name the methods in the Methods intro so the rule is searchable. State
the constraint on supported_pair_methods in both directions: the client
MUST NOT list both code methods, and a server that receives both
disregards static_pairing_code, so a non-conformant advertisement
degrades to the safer method instead of undefined behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Maxim Raznatovski <nda.mr43@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@balloobbot
balloobbot force-pushed the one-pairing-code-method branch from e9c6afa to 1edf355 Compare September 2, 2026 13:13
The advice stays in the spec until an implementation guide exists to hold
it. Lowercase keywords keep it out of conformance, and the clause telling
clients to also ship `static_pairing_code` disabled is gone because a
client may now offer only one pairing-code method.
@maximmaxim345
maximmaxim345 merged commit 8c9577e into Sendspin:main Sep 2, 2026
1 check passed
@arturpragacz arturpragacz mentioned this pull request Sep 16, 2026
1 task done
arturpragacz added a commit that referenced this pull request Sep 16, 2026
<!-- Describe the change and why it is needed. -->

Move the one-pairing-code-method cap to implementation guide.

#189 capped clients at one pairing-code method and added a server rule
for advertisements that list both. #186 recorded that the cap is not a
wire change: `supported_pair_methods` carries whatever the client
offers, and `server/activate` names one method. The reason for the cap
was UX, offering users both options is too confusing, which is a product
decision of the same kind #189 moved out of the spec for method choice.
#205 already lists it under the guide's "Pairing method choice" entry.

This relocates the rule rather than reversing it. Clients should still
offer one pairing-code method; that guidance, plus "a server offered
both prefers `dynamic_pairing_code`", goes to the implementation guide.

- [x] I accept the [Contributor License
Agreement](../blob/main/CONTRIBUTOR-LICENSE-AGREEMENT.md) for this
contribution.

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
chrisuthe added a commit to Sendspin/aiosendspin that referenced this pull request Sep 16, 2026
#354)

# What does this implement/fix?

Implements spec [#179](Sendspin/spec#179) and
[#189](Sendspin/spec#189), plus the
ignore-unrecognized-identifiers rule from
[#178](Sendspin/spec#178) that shares the same
parse path.

`supported_pair_methods` in `client/hello` becomes an object keyed by
pairing method identifier rather than a list of self-describing
descriptors, the reader ignores identifiers and values it does not
recognize, and a server offered both pairing-code methods prefers
`dynamic_pairing_code` (spec #285 moved the one-method cap to the
implementation guide).

Clients on the superseded list wire keep working: the server rewrites
the shape and flags it, as it already does for unversioned support keys
and pre-rename artwork dimensions. Their tests are kept as legacy-wire
acceptance tests.

One judgement call worth a look. An unrecognized method identifier is
logged, not sent through `_flag_noncompliance`: such a client is
conformant per `pairing.md:318`, so flagging it would make a server
running `allow_noncompliant_clients=False` reject spec-compliant
clients. Offering both code methods is conformant since spec #285, so it
is logged too; the SDK client still offers only the dynamic one.

**Related issue (if applicable):**

- n/a

## Types of changes

- [x] Enhancement to an existing feature — `enhancement`

## Checklist

- [x] The code change is tested and works locally.
- [x] `pre-commit run --all-files` passes.
- [x] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
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.

Decide: allow at most one pairing-code method per client Decide: keep or trim the pairing-method steering

5 participants