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

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

Open
GlenDC opened this issue Nov 11, 2024 · 4 comments
Open
Assignees
Labels
easy An easy issue to pick up for anyone. 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 Nov 11, 2024

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:

  • provide also support for [Basic; N], Vec<Basic>, [Bearer; N] and Vec<Bearer>;
  • but also to support Arc<...> support

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

  • providing a "sealed" (private) trait "Authorizer" which is implemented for 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.

@GlenDC GlenDC added low prio Low priority item. easy An easy issue to pick up for anyone. mentor available A mentor is available to help you through the issue. labels Nov 11, 2024
@GlenDC GlenDC added this to the v0.3 milestone Nov 11, 2024
@npalladium
Copy link

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

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

@GlenDC
Copy link
Member Author

GlenDC commented Nov 15, 2024

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.

  • Do you need a more verbose description?
  • Do you need me to provide you with some starter code that you can then fill in and learn from like that?
  • You have enough information as is?
  • Something else?

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
Copy link

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
Copy link
Member Author

GlenDC commented Nov 18, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy An easy issue to pick up for anyone. 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