feat(protocol): discover advertised OCF secure ports - #36
Conversation
|
Thanks for taking this on. Two things I'd like to work through before merging, both about scope rather than correctness. The CoAP layer
Two CoAP implementations in one package means every wire-level fix has to be made twice, and the Samsung-specific ones are the ones that hurt. Token-stable Block2 and the ACK-plus-separate-CON pattern took a long time to get right in the session; a second parser that hasn't met those devices will rediscover them the hard way. Can the discovery path build on Two entry points, and what they add over probingThe PR ships
What I'd like to doLand the known-host unicast path on its own, built on Your bounds work is the strongest part of this and I'd keep all of it: the shared deadline across retries, the per-round datagram cap, the exact normalized Happy to look at a reduced version whenever you have time. If you'd rather I did the |
1ca0875 to
a9b7af6
Compare
|
Thanks — I followed the reduced-scope direction and updated the branch myself.
One clarification on the held multicast path: WD86 is shorthand here for the observed internal SmartThings/firmware family Validation on the updated head:
The new GitHub Actions run is currently awaiting maintainer approval, so I am not carrying forward the previous head's 8/8 result. |
Summary
discover_ocf_secure_ports()API for device-advertised OCF secure portsprotocol/coap.py/oic/resfirst for source-boundcoapsendpoints, then fall back to/oic/res?rt=oic.r.doxmwithin the same monotonic deadlineWhat directory discovery adds
probe_dtls_ports()verifies only the candidate ports supplied by its caller. Directory discovery obtains the ports advertised by the device itself, including valid dynamic ports outside a caller's fixed candidate band, and then lets the caller pass those candidates to the existing stateless probe.This distinction is also visible in the current issue #16 evidence: the advertised secure endpoint can fall outside both the standard OCF port and the bridge's fixed dynamic candidates. Discovery therefore generates candidates; probing verifies listeners. Neither step authenticates a device by itself.
Scope and WD86 context
Following the maintainer feedback, this revision contains only the known-host unicast API. The identity-aware multicast API has been removed from this PR and preserved on
atc722:agent/ocf-identity-multicast-heldfor a later proposal with a concrete caller.In this discussion, WD86 is shorthand for the observed internal SmartThings/firmware family
AWM-KR-M64-24-WD86of a Samsung washer-dryer combo (oic.d.washer); it is not presented as a retail model number. Redacted testing showed that its OCF host can expose multiple logical device containers, so exactdi-to-source-to-endpoint binding is still required by that downstream target-selection path. The package does not yet have a production caller for that multicast API, which is why it is held rather than included here. Device-specific addresses, UUIDs, and advertised port values are intentionally omitted.Bounds and safety
coapsendpoints; no DNS lookup of an advertised hostnameValidation
python -m pytest -q: 239 passed locally on Python 3.13git diff --check origin/main...HEADpython tools/check_share_safety.py --changed-since origin/mainThe repository CI matrix remains responsible for Python 3.11, 3.12, and 3.14 coverage on the updated head.