fastapi/docs_src/security
Baha Rahmouni 3797c3ca61 Add API Key Header authentication documentation
- Addresses issue #142 (32 👍 from community)
- Add comprehensive API Key authentication tutorial
- Include both simple and complete examples
- Add full test coverage (7 test cases)
- Integrate into existing security documentation

Files added:
- docs/en/docs/tutorial/security/api-key.md: Complete tutorial
- docs_src/security/tutorial_api_key_header.py: Full example
- docs_src/security/tutorial_api_key_simple.py: Simple example
- tests/test_tutorial_api_key_header.py: Test suite

Files modified:
- docs/en/docs/tutorial/security/index.md: Updated navigation
2025-08-13 11:58:43 +01:00
..
tutorial001.py Auto-generate OpenAPI servers from root_path (#1596) 2020-07-10 19:28:18 +02:00
tutorial001_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002.py 📝 Add docs recommending `Union` over `Optional` and migrate source examples (#4908) 2022-05-14 06:59:59 -05:00
tutorial002_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002_an_py310.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002_py310.py Add docs and tests for Python 3.9 and Python 3.10 (#3712) 2022-01-07 15:11:31 +01:00
tutorial003.py 📝 Add docs recommending `Union` over `Optional` and migrate source examples (#4908) 2022-05-14 06:59:59 -05:00
tutorial003_an.py ⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
tutorial003_an_py39.py ⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
tutorial003_an_py310.py ⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
tutorial003_py310.py Add docs and tests for Python 3.9 and Python 3.10 (#3712) 2022-01-07 15:11:31 +01:00
tutorial004.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial004_an.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial004_an_py39.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial004_an_py310.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial004_py310.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial005.py 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose (#11589) 2024-05-20 10:37:28 -07:00
tutorial005_an.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial005_an_py39.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial005_an_py310.py 🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378) 2025-02-15 17:28:09 +01:00
tutorial005_py39.py 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose (#11589) 2024-05-20 10:37:28 -07:00
tutorial005_py310.py 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose (#11589) 2024-05-20 10:37:28 -07:00
tutorial006.py Add support for docs translations (#1168) 2020-03-26 20:09:53 +01:00
tutorial006_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial006_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial007.py 📝 Replace `email` with `username` in `docs_src/security/tutorial007` code examples (#10649) 2024-01-11 09:33:05 -05:00
tutorial007_an.py ⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
tutorial007_an_py39.py ⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
tutorial_api_key_header.py Add API Key Header authentication documentation 2025-08-13 11:58:43 +01:00
tutorial_api_key_simple.py Add API Key Header authentication documentation 2025-08-13 11:58:43 +01:00