Closed rgarlik closed 1 year ago
Patch coverage has no change and project coverage change: +3.92
:tada:
Comparison is base (
4aef1b7
) 51.83% compared to head (711733e
) 55.76%.:exclamation: Current head 711733e differs from pull request most recent head d248474. Consider uploading reports for the commit d248474 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@rgarlik
First off, thank you so much for publishing this PR! The overall idea is great and is a welcome change!
Before we merge this, could you add some tests to check against the happy and unhappy paths?
Also, if you run cargo fmt
before publishing commits, cargo will automatically format the code to be aligned with the style specified in the .rustfmt.toml
file.
Hey @DrPoppyseed, I apologize, I had a lot of stuff going on. I've pushed all of the changes you were talking about. You can go ahead and check it out.
By the way, I had a job interview the other day and the interviewer saw this PR and asked a bit about it, I think it kinda helped me because he doesn't see a lot of people do Rust stuff. I didn't even know he'd see it lol.
added the changes you wanted, only thing left is the one where I left the discussion open
Sorry it took so long! Merging it in!
This PR adds a
FirebaseToken
guard that greatly improves the user experience when implementing route handlers by eliminating the need of manually checking token validity. Simply including theFirebaseToken
guard rejects traffic that lacks an auth header or that includes an invalid Firebase JWT. This PR solves #4.Example usage:
This should not break compatibility with old implementations of the library (manual token checking in handler function body). I also think this should be the preferred way of using the library.
A full list of changes:
Excited to hear your thoughts and feedback.