Skip to content

Hybrid transport: Switch to event-driven discovery#98

Merged
AlfioEmanueleFresta merged 2 commits into
masterfrom
cable-event-driven
May 8, 2025
Merged

Hybrid transport: Switch to event-driven discovery#98
AlfioEmanueleFresta merged 2 commits into
masterfrom
cable-event-driven

Conversation

@AlfioEmanueleFresta
Copy link
Copy Markdown
Member

@AlfioEmanueleFresta AlfioEmanueleFresta commented May 5, 2025

Changes

  • Switches from a periodic polling approach, to an event-driven discovery. It uses btleplug's event system to wait for a BLE advertisement. This is guaranteed to occur after the QR code is generated, making this safe.
  • Fixes iOS discovery limitation, by removing UUID filter for BlueZ device discovery. This seems to be a limitation in BlueZ (it wouldn't be the first), that I could not find a workaround for. It should have no significant downside, however, as discovered devices that don't include the relevant service data are ignored (we do not attempt connecting to them).

Testing

Tested on an iPhone, and Android 15. Example webauthn_cable succeeds consistently.

@AlfioEmanueleFresta AlfioEmanueleFresta requested review from Copilot and msirringhaus and removed request for Copilot May 5, 2025 16:43
Base automatically changed from cable-fix to master May 6, 2025 07:02
Copy link
Copy Markdown
Collaborator

@msirringhaus msirringhaus left a comment

Choose a reason for hiding this comment

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

I've left some minor comments

Comment thread libwebauthn/src/transport/ble/btleplug/manager.rs Outdated
Comment thread libwebauthn/src/transport/ble/btleplug/manager.rs Outdated
Comment thread libwebauthn/src/transport/cable/qr_code_device.rs Outdated
Comment thread libwebauthn/src/transport/cable/qr_code_device.rs Outdated
Comment thread libwebauthn/src/transport/cable/qr_code_device.rs

This comment was marked as outdated.

@AlfioEmanueleFresta
Copy link
Copy Markdown
Member Author

Thanks @msirringhaus! Addressed your comments.

Copy link
Copy Markdown
Collaborator

@msirringhaus msirringhaus left a comment

Choose a reason for hiding this comment

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

Thank you!

@AlfioEmanueleFresta AlfioEmanueleFresta merged commit b017fd5 into master May 8, 2025
4 checks passed
@AlfioEmanueleFresta AlfioEmanueleFresta deleted the cable-event-driven branch May 8, 2025 18:46
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.

3 participants