Closed thynson closed 3 weeks ago
I'm not sure if ConnectionIdValidator
should be move to quinn_proto::shared
.
What does this new trait add over the caller performing whatever validation they like themselves after decoding a header, as is already done with ConnectionIdGenerator::validate
?
What does this new trait add over the caller performing whatever validation they like themselves after decoding a header, as is already done with
ConnectionIdGenerator::validate
?
It looks like parsing the header needs the expected CID len as input.
Thanks for review. I'm going to polish it based on your comments
The idea of ConnectionIdValidator
comes from s2n-quic, but they have Validator
and Generator
and Format: Validator + Generator
(see here is what s2n-quic does).
While in quinn, ConnectionIdGenerator
has validate
for now, so the duplication of functionality seems unavoidable unless we change trait ConnectionIdGenerator
to requires ConnectionIdParser
. Shall we go in this way?
While in quinn,
ConnectionIdGenerator
hasvalidate
for now, so the duplication of functionality seems unavoidable unless we change traitConnectionIdGenerator
to requiresConnectionIdParser
. Shall we go in this way?
After further digging, I believe ConnectionIdGenerator.parse
and ConnectionIdValidator.validate
provides different semantics. The former is used to decide whether a state-less reset should be sent, so rename ConnectionIdValidator
to ConnectionIdParser
seems right to me.
I ended up squashing and reordering these changes. I changed the commits to (a) first make the APIs public and then (b) add the ConnectionIdParser
trait and implementation. The previous approach had some intermediate states that did not make sense. @thynson can you check that this still satisfies your use case (there should be no changes in terms of the final public API, but still good to check)?
It's totally fine to me .
Context: #1860.
This PR did a bit more than just expose symbols to public, a trait
ConnectionIdValidator
was introduced, due to the fact that a QUIC Load balancer have to support different kind of Connection ID Schemes, per QUIC-LB-DRAFT Secion 4.1. Also some documents was added to suppress the clippy warning after those symbol being made public.