- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for APIKeyHeader (0.71 sec)
-
tests/test_security_api_key_header_description.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyHeader from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyHeader(name="key", description="An API Key Header") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_security_api_key_header.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyHeader from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyHeader(name="key") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user @app.get("/users/me")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.8K bytes - Viewed (0) -
tests/test_security_api_key_header_optional.py
from typing import Optional from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyHeader from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyHeader(name="key", auto_error=False) class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(api_key)): if oauth_header is None: return None
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Viewed (0) -
fastapi/security/__init__.py
from .api_key import APIKeyCookie as APIKeyCookie from .api_key import APIKeyHeader as APIKeyHeader from .api_key import APIKeyQuery as APIKeyQuery from .http import HTTPAuthorizationCredentials as HTTPAuthorizationCredentials from .http import HTTPBasic as HTTPBasic from .http import HTTPBasicCredentials as HTTPBasicCredentials from .http import HTTPBearer as HTTPBearer from .http import HTTPDigest as HTTPDigest from .oauth2 import OAuth2 as OAuth2
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Dec 20 18:50:00 GMT 2020 - 881 bytes - Viewed (0) -
docs/de/docs/reference/security/index.md
Sie können sie von `fastapi.security` importieren: ```python from fastapi.security import ( APIKeyCookie, APIKeyHeader, APIKeyQuery, HTTPAuthorizationCredentials, HTTPBasic, HTTPBasicCredentials, HTTPBearer, HTTPDigest, OAuth2, OAuth2AuthorizationCodeBearer, OAuth2PasswordBearer,
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 18:15:05 GMT 2024 - 1.8K bytes - Viewed (0) -
docs/en/docs/reference/security/index.md
You can import them from `fastapi.security`: ```python from fastapi.security import ( APIKeyCookie, APIKeyHeader, APIKeyQuery, HTTPAuthorizationCredentials, HTTPBasic, HTTPBasicCredentials, HTTPBearer, HTTPDigest, OAuth2, OAuth2AuthorizationCodeBearer, OAuth2PasswordBearer,
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 1.6K bytes - Viewed (0) -
fastapi/security/api_key.py
The dependency result will be a string containing the key value. ## Example ```python from fastapi import Depends, FastAPI from fastapi.security import APIKeyHeader app = FastAPI() header_scheme = APIKeyHeader(name="x-key") @app.get("/items/") async def read_items(key: str = Depends(header_scheme)): return {"key": key} ``` """
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 23 22:29:18 GMT 2024 - 9.1K bytes - Viewed (0)