Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port over http cookie layer logic #44

Open
GlenDC opened this issue Jan 10, 2024 · 5 comments
Open

port over http cookie layer logic #44

GlenDC opened this issue Jan 10, 2024 · 5 comments
Labels
good first issue Good for newcomers low prio Low priority item. mentor available A mentor is available to help you through the issue.
Milestone

Comments

@GlenDC
Copy link
Member

GlenDC commented Jan 10, 2024

This story is about porting over https://docs.rs/tower-cookies/latest/tower_cookies/ and make it available under rama::http::layer::cookie (a new module) => https://github.com/plabayo/rama/tree/main/src/http/layer.

Ready for others to pick up as there is no immediate plans to work on it. Feel free to ask questions here or on discord, or ask for help or guidance. I am here for you. Once we are working towards the v0.3 milestone I might pick it up at some point myself if no one volunteered by then.

@GlenDC GlenDC modified the milestones: v0.2, v0.3 Jan 10, 2024
@GlenDC GlenDC added good first issue Good for newcomers low prio Low priority item. labels Feb 29, 2024
@GlenDC
Copy link
Member Author

GlenDC commented Mar 15, 2024

It probably also makes sense to take https://www.lpalmieri.com/posts/biscotti-http-cookies-in-rust/ into account and see if there are lessons that can be applied from there in this porting work.

@GlenDC GlenDC added the mentor available A mentor is available to help you through the issue. label Mar 15, 2024
@parkma99
Copy link
Contributor

Hi @GlenDC I would like to take it.I am confusing about where to start it. A cookie manager in rama::http::layer::cookie? Thanks for your helping.

@GlenDC
Copy link
Member Author

GlenDC commented Oct 25, 2024

Hi sure, do know that this issue is a lot more involved and will take quit some work and time to get this one finished. Wouldn't be surprised if it takes 3 full work days up to a week, depending how fast you are. So it's definitely not a small one by any chance.

If you want something smaller or easier (for now), these are so far still available as well:

That said if you do want to take it, it is possible,
but it will require some tinkering and iteration on top of the regular development work
as I'm not yet sure how exactly to do it.

  • first of all we would have to decide what we use as our foundational cookie logic:
    • do we write something ourselves? Probably not
    • do we fork something existing and embed it, maybe
    • do we use cookie? maybe
    • do we use biscotti? maybe, but it would either limit us for client purposes or we would need to fork it
  • we need to see how we'll split up the server vs client logic
  • there's also a cookiejar, most likely you want it in the State of Context<State> as that can be mutated, but it would mean you rely on that to be there available via std::convert::AsMut trait bound for a cookiejar

For now not sure how it would all fit together or be implemented. I was holding off the design for this for 0.3, and as such it's low prio. If you think you need it earlier, or feel motivated and have the skills to push it forward, do tell me and you can take it. Otherwise I would suggest to go for another issue first.

@GlenDC
Copy link
Member Author

GlenDC commented Oct 25, 2024

Actually thinking about it. Most like likely we'll want to fork biscotti as rama-http-cookie, given we'll want to

  • be able to parse Set-Cookie headers
  • have client + server support
  • be able to pass on cookies in their original form, unless desired otherwise, even if not RFC compliant

This is really a big task, to do on top of the integration as layers and services, and examples. I think you might want to take up another task, as I feel this is too much to ask. Do tell me if you think otherwise though. Don't want to speak for you either.

@parkma99
Copy link
Contributor

Thanks,I will look #328 #332 if I have time. This is really a big task, and I think I shoud do some simple tasks to be familiar with rama.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers low prio Low priority item. mentor available A mentor is available to help you through the issue.
Projects
None yet
Development

No branches or pull requests

2 participants