From 0fc3ff387d98c2845352bbc40c885e6863fc5917 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 02:48:40 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/tutorial/security/index.md | 6 ++---- docs/es/docs/tutorial/security/index.md | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/en/docs/tutorial/security/index.md b/docs/en/docs/tutorial/security/index.md index e56b36ef4..077d8d6d7 100644 --- a/docs/en/docs/tutorial/security/index.md +++ b/docs/en/docs/tutorial/security/index.md @@ -107,7 +107,7 @@ And you will also see how it gets automatically integrated into the interactive ## API Key in Header -An API key is a simple secret string that a client sends with every request. +An API key is a simple secret string that a client sends with every request. It is often used for: - machine-to-machine communication, @@ -120,7 +120,7 @@ FastAPI provides tools for these in the `fastapi.security` module, including `AP ### Define an API key in a header -In this example, the client must send an API key in the HTTP header `X-API-Key`. +In this example, the client must send an API key in the HTTP header `X-API-Key`. We’ll require the exact value `"supersecret"` to access a protected route. ```Python @@ -135,5 +135,3 @@ API_KEY = "supersecret" API_KEY_NAME = "X-API-Key" api_key_header = APIKeyHeader(name=API_KEY_NAME, auto_error=False) - - diff --git a/docs/es/docs/tutorial/security/index.md b/docs/es/docs/tutorial/security/index.md index c032eb13d..606767f4c 100644 --- a/docs/es/docs/tutorial/security/index.md +++ b/docs/es/docs/tutorial/security/index.md @@ -107,7 +107,7 @@ Y también verás cómo se integra automáticamente en el sistema de documentaci ## API Key en el Header -Una API key es una cadena secreta sencilla que un cliente envía con cada petición. +Una API key es una cadena secreta sencilla que un cliente envía con cada petición. Suele utilizarse para: - comunicación entre servicios, @@ -120,7 +120,7 @@ FastAPI incluye utilidades para esto en el módulo `fastapi.security`, incluyend ### Definir la API key en un header -En este ejemplo, el cliente debe enviar una API key en el header HTTP `X-API-Key`. +En este ejemplo, el cliente debe enviar una API key en el header HTTP `X-API-Key`. Requeriremos que el valor sea exactamente `"supersecret"` para acceder a una ruta protegida. ```Python @@ -135,4 +135,3 @@ API_KEY = "supersecret" API_KEY_NAME = "X-API-Key" api_key_header = APIKeyHeader(name=API_KEY_NAME, auto_error=False) -