Coder Social home page Coder Social logo

Rotation of Connection IDs about quinn HOT 5 CLOSED

thynson avatar thynson commented on June 27, 2024
Rotation of Connection IDs

from quinn.

Comments (5)

djc avatar djc commented on June 27, 2024 1

I suppose we could add ConnectionIdGenerator::expire_time() with a default implementation that yields None such that it wouldn't be breaking, so that sounds like we don't have to hold the release for it.

from quinn.

Ralith avatar Ralith commented on June 27, 2024 1

Add fn expire_time() -> Option<Duration> to the trait ConnectionIdGenerator.

This already exists: ConnectionIdGenerator::cid_lifetime. Is anything else needed?

See also the queue machinery in CidState, Timer::PushNewCid, etc.

from quinn.

djc avatar djc commented on June 27, 2024

I think we'd be open to that, but it's unclear to me how this would affect the API. Do you want to submit a PR in that direction? Should we hold the release for that so that we can change the API some more?

from quinn.

thynson avatar thynson commented on June 27, 2024

I think we'd be open to that, but it's unclear to me how this would affect the API.

I think the first part can be implemented without API change.
On the second part, I currently come up two way to implementing it:

  • Add fn cid_expire_time(duration: Option<Duration>) to EndpointConfig.

  • Add fn expire_time() -> Option<Duration> to the trait ConnectionIdGenerator.

The former should be cleaner and requires no breaking change, the latter seems reasonable that the implementation should know an expiration time of a cid and can even perform cid validation when parsing but could be over complicated.

Do you want to submit a PR in that direction? Should we hold the release for that so that we can change the API some more?

Yes, I definitely want to submit PRs for it but I don't have a schedule for it yet. And unless we decided to add expire_time to ConnectionIdGenerator so it'd better to land it together with #1879, I think we don't need hold the release for it.

from quinn.

thynson avatar thynson commented on June 27, 2024

This already exists: ConnectionIdGenerator::cid_lifetime. Is anything else needed?

Ahh, no idea why I missed it, it should be enough for rotating Connection ID.

from quinn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.