Skip to content

Allow multiple valid bearer keys for ValidateRequestHeaderLayer #485

@ifsheldon

Description

@ifsheldon
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions