open-coap / java-coap

CoAP Java library
Apache License 2.0
18 stars 5 forks source link

Minimal support for Echo and Request-tag [RFC 9175] #66

Closed szysas closed 9 months ago

szysas commented 9 months ago
codecov[bot] commented 9 months ago

Codecov Report

Patch coverage: 97.56% and project coverage change: +0.03% :tada:

Comparison is base (947f8bc) 92.84% compared to head (163393e) 92.87%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #66 +/- ## ============================================ + Coverage 92.84% 92.87% +0.03% - Complexity 1979 2018 +39 ============================================ Files 130 132 +2 Lines 4400 4465 +65 Branches 607 617 +10 ============================================ + Hits 4085 4147 +62 Misses 173 173 - Partials 142 145 +3 ``` | [Files Changed](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap) | Coverage Δ | | |---|---|---| | [.../main/java/com/mbed/coap/packet/HeaderOptions.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9wYWNrZXQvSGVhZGVyT3B0aW9ucy5qYXZh) | `97.05% <92.59%> (-1.61%)` | :arrow_down: | | [.../java/com/mbed/coap/packet/CoapOptionsBuilder.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9wYWNrZXQvQ29hcE9wdGlvbnNCdWlsZGVyLmphdmE=) | `89.33% <100.00%> (+1.45%)` | :arrow_up: | | [...n/java/com/mbed/coap/server/CoapServerBuilder.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvQ29hcFNlcnZlckJ1aWxkZXIuamF2YQ==) | `91.52% <100.00%> (+0.29%)` | :arrow_up: | | [...ava/com/mbed/coap/server/block/BlockRequestId.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvYmxvY2svQmxvY2tSZXF1ZXN0SWQuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [.../com/mbed/coap/server/block/BlockWiseCallback.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvYmxvY2svQmxvY2tXaXNlQ2FsbGJhY2suamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...bed/coap/server/block/BlockWiseIncomingFilter.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvYmxvY2svQmxvY2tXaXNlSW5jb21pbmdGaWx0ZXIuamF2YQ==) | `95.52% <100.00%> (+0.20%)` | :arrow_up: | | [...oap/server/block/BlockWiseIncomingTransaction.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvYmxvY2svQmxvY2tXaXNlSW5jb21pbmdUcmFuc2FjdGlvbi5qYXZh) | `95.74% <100.00%> (+0.18%)` | :arrow_up: | | [.../com/mbed/coap/server/block/BlockWiseTransfer.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvYmxvY2svQmxvY2tXaXNlVHJhbnNmZXIuamF2YQ==) | `97.22% <100.00%> (+0.44%)` | :arrow_up: | | [...n/java/com/mbed/coap/server/filter/EchoFilter.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvZmlsdGVyL0VjaG9GaWx0ZXIuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...a/com/mbed/coap/server/messaging/Capabilities.java](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9zZXJ2ZXIvbWVzc2FnaW5nL0NhcGFiaWxpdGllcy5qYXZh) | `96.55% <100.00%> (+0.25%)` | :arrow_up: | | ... and [1 more](https://app.codecov.io/gh/open-coap/java-coap/pull/66?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/open-coap/java-coap/pull/66/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sbernard31 commented 9 months ago

I understand that you implement,

For echo Option:
At client side, if server send 4.01 Unauthorized + Echo Option resend request with Echo option.

For Request-tag Option:
At client side, for block1(only?) you automatically add request-tag option. At server side, if client send concurrent block request, you only keep the more recently started transfer (like before) and now you are able to reject old block request (identified by request-tag) with 408 REQUEST_ENTITY_INCOMPLETE.

Right ?

sbernard31 commented 9 months ago

I understand that request-tag is only needed for coap+tcp, if you want to be able to do concurrent transfert :

Note that this mechanism is implicitly implemented when the security layer guarantees ordered delivery (e.g., CoAP over TLS [RFC8323]). This is because, with each message, any earlier message cannot be replayed any more, so the client never needs to set the Request-Tag option unless it wants to perform concurrent operations.

(From : https://www.rfc-editor.org/rfc/rfc9175#section-3.5.1)

So I don't know if you want to add request-tag automatically with coap+tcp ?

szysas commented 9 months ago

I understand that you implement,

For echo Option: At client side, if server send 4.01 Unauthorized + Echo Option resend request with Echo option.

For Request-tag Option: At client side, for block1(only?) you automatically add request-tag option. At server side, if client send concurrent block request, you only keep the more recently started transfer (like before) and now you are able to reject old block request (identified by request-tag) with 408 REQUEST_ENTITY_INCOMPLETE.

Right ?

Exactly.

So I don't know if you want to add request-tag automatically with coap+tcp ?

With current change, it is not used in coap+tcp as that has a different builder class (CoapServerBuilderForTcp)