Skip to content

Make check_hash controller agnostic #22

@danielorihuela

Description

@danielorihuela

I'm currently playing with the crate and it's very easy and works as expected. Congratulations! However, I found something strange. I'm forced to set up a prefix for the controller in order to call check_hash. For example, if you want to check the key from the backend side, you wouldn't have to add a prefix. You just want to verify that the hash matches. The prefix is not relevant in that use case.

I don't know if this is expected to be like that but seems odd.

A possible solution would be to have a VerifierController implementing a configure function which returns a ControllerBuilder with the prefix set to an empty string.
Another possible solution would be to add a new function configure_verifier for PrefixedApiKeyController that returns a ControllerBuilder with the prefix set to an empty string.

If this is really an issue and you are open to modifications, I would suggest the second option. It's a simple helper function that won't have big impact in your codebase. If you are open to PR, I'm willing to implement it.

Thank you! @brahmlower

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions