fastapi
fastapi copied to clipboard
Use FastApi HTTPException in api_key exceptions
Related to #3383
Hi, I changed the exception the same way OAuth is doing, and also added the proper header to the APIKeyHeader
response and checked its presence at the test.
It's my first-time contribution, hope I'm following the contributing steps properly :slightly_smiling_face:
Codecov Report
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:
Coverage data is based on head (
b556c9d
) compared to base (cf73051
). Patch coverage: 100.00% of modified lines in pull request are covered.
:exclamation: Current head b556c9d differs from pull request most recent head f7b0e25. Consider uploading reports for the commit f7b0e25 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #3703 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 540 540
Lines 13969 13952 -17
=========================================
- Hits 13969 13952 -17
Impacted Files | Coverage Δ | |
---|---|---|
fastapi/security/api_key.py | 100.00% <100.00%> (ø) |
|
tests/test_security_api_key_header.py | 100.00% <100.00%> (ø) |
|
tests/utils.py | 100.00% <0.00%> (ø) |
|
fastapi/utils.py | 100.00% <0.00%> (ø) |
|
fastapi/routing.py | 100.00% <0.00%> (ø) |
|
fastapi/concurrency.py | 100.00% <0.00%> (ø) |
|
fastapi/applications.py | 100.00% <0.00%> (ø) |
|
tests/test_datastructures.py | 100.00% <0.00%> (ø) |
|
fastapi/dependencies/utils.py | 100.00% <0.00%> (ø) |
|
tests/test_union_inherited_body.py | 100.00% <0.00%> (ø) |
|
... and 2 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
📝 Docs preview for commit b556c9d944fab73074620a74eaf184c8e0dc015e at: https://631e12a73fbe0749fb520813--fastapi.netlify.app
📝 Docs preview for commit f7b0e25ec9d726409e5ad7b3faf4c30ba3fd2ef3 at: https://639cd201a6979e14fdd38d25--fastapi.netlify.app
Hey @humrochagf, thanks for the interest! ☕
I am not sure I understand what would this change solve or how it would be needed. It's probably better to start in a GitHub Discussion following the template step by step, that would make it easier for me and others to better understand your use case and help you: https://github.com/tiangolo/fastapi/discussions/new?category=questions
For now, I'll pass on this one, but thanks for the effort! 🍰
Hey, no problem, the pr was more to address the open issue that at the time was labeled as feature.