pre-commit-ci-lite[bot]
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
3 deletions
-
tests/test_security_oauth2_client_credentials_description.py
|
|
|
@ -1,5 +1,3 @@ |
|
|
|
from typing import Optional |
|
|
|
|
|
|
|
from fastapi import FastAPI, Security |
|
|
|
from fastapi.security import OAuth2ClientCredentials |
|
|
|
from fastapi.testclient import TestClient |
|
|
|
@ -14,7 +12,7 @@ oauth2_scheme = OAuth2ClientCredentials( |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/items/") |
|
|
|
async def read_items(token: Optional[str] = Security(oauth2_scheme)): |
|
|
|
async def read_items(token: str | None = Security(oauth2_scheme)): |
|
|
|
return {"token": token} |
|
|
|
|
|
|
|
|
|
|
|
|