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

Allow multiple valid bearer keys for ValidateRequestHeaderLayer #485

Open
1 task done
ifsheldon opened this issue Apr 26, 2024 · 0 comments
Open
1 task done

Allow multiple valid bearer keys for ValidateRequestHeaderLayer #485

ifsheldon opened this issue Apr 26, 2024 · 0 comments

Comments

@ifsheldon
Copy link

  • I have looked for existing issues (including closed) about this

Feature Request

Motivation

I found tower_http::validate_request::ValidateRequestHeaderLayer::bearer very convenient, but it's a bit too simplistic. I am thinking maybe we can have a layer that checks a lookup table that is dynamically changing, which should cover most of the use cases.

Proposal

I think we can let developers pass a closure which checks if a bearer token passed in the closure is valid or not, this should give them max flexibility.

Alternatives

Or, we can allow them to pass an object that impl a new trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant