plabayo / rama

modular service framework to move and transform network packets
https://ramaproxy.org
Apache License 2.0
180 stars 21 forks source link

suport multiple basic/bearer credentials for 'Authorization' server support #352

Open GlenDC opened 1 week ago

GlenDC commented 1 week ago

We already have support for this header for a single Basic / Bearer credential as can be found in https://github.com/plabayo/rama/blob/main/rama-http/src/layer/auth/require_authorization.rs.

Goal of this issue is to:

In order to support this all it is probably easiest to refactor the code a bit by:

This way you only need a single implementation of the actual authorize/anonymouse logic as the actual authorization validation can be done by the Authorizer trait.

This issue is low priority, but due to a contribution from someone recently I noticed that we don't have support for multiple credentials here yet, while we do have that support for Proxy-Authorization. Mentorship is available for this one.

npalladium commented 3 days ago

Hi @GlenDC, I'd like to take this one up.

I'm new to the codebase and fairly new to Rust though.

GlenDC commented 3 days ago

hi @npalladium . All yours. As you are new to Rust you might want extra mentorship and help, so please let me know how I can best guide you.

Next to that, feel free to open a PR whenever you are stuck, need help, guidance or anything else. Ask here also questions or provide feedback as you see fit.

Welcome to the rama repo and I hope to see you around! :)

npalladium commented 5 hours ago

Hi @GlenDC. I think the requirements are clear.

I'm looking at the adjacent code right now. I hope to have a draft PR ready sometime tomorrow. I'll let you know in the PR or on this issue if I need any help.

GlenDC commented 3 hours ago

Sounds great. Do feel free to open the PR even if it doesn't compile, in case you have questions, feedback or in need of help in general. Thanks for your valued time and contribution!