- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for Account (0.16 sec)
-
tests/test_security_http_basic_optional.py
security = HTTPBasic(auto_error=False) @app.get("/users/me") def read_current_user(credentials: Optional[HTTPBasicCredentials] = Security(security)): if credentials is None: return {"msg": "Create an account first"} return {"username": credentials.username, "password": credentials.password} client = TestClient(app) def test_security_http_basic(): response = client.get("/users/me", auth=("john", "secret"))
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.6K bytes - Viewed (0)