Open GlenDC opened 1 week ago
Hi @GlenDC, I'd like to take this one up.
I'm new to the codebase and fairly new to Rust though.
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! :)
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.
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!
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:
[Basic; N]
,Vec<Basic>
,[Bearer; N]
andVec<Bearer>
;Arc<...>
supportIn order to support this all it is probably easiest to refactor the code a bit by:
Basic
,Bearer
,Vec<impl Authorizer>
,[impl Authorizer; N]
,Arc<Authorizer>
.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.