- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 250 for user1s (1.46 sec)
-
docs/en/docs/tutorial/security/get-current-user.md
``` ## Create a `get_current_user` dependency Let's create a dependency `get_current_user`. Remember that dependencies can have sub-dependencies? `get_current_user` will have a dependency with the same `oauth2_scheme` we created before. The same as we were doing before in the *path operation* directly, our new dependency `get_current_user` will receive a `token` as a `str` from the sub-dependency `oauth2_scheme`:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 7.6K bytes - Viewed (0) -
tests/test_tutorial/test_testing_dependencies/test_tutorial001_py310.py
@needs_py310 def test_override_in_users(): from docs_src.dependency_testing.tutorial001_py310 import client response = client.get("/users/") assert response.status_code == 200, response.text assert response.json() == { "message": "Hello Users!", "params": {"q": None, "skip": 5, "limit": 10}, } @needs_py310 def test_override_in_users_with_q():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_an.py
} }, "summary": "Read Users Me", "operationId": "read_users_me_users_me__get", "security": [{"OAuth2PasswordBearer": ["me"]}], } }, "/users/me/items/": { "get": { "responses": { "200": {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Mar 13 19:07:10 GMT 2024 - 15.4K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial012_an.py
}, }, }, } }, "/users/": { "get": { "summary": "Read Users", "operationId": "read_users_users__get", "parameters": [ { "required": True,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 8.4K bytes - Viewed (0) -
tests/test_tutorial/test_bigger_applications/test_main_an.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 24.6K bytes - Viewed (0) -
tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 24.9K bytes - Viewed (0) -
tests/test_security_http_bearer_description.py
security = HTTPBearer(description="HTTP Bearer token scheme") @app.get("/users/me") def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)): return {"scheme": credentials.scheme, "credentials": credentials.credentials} client = TestClient(app) def test_security_http_bearer(): response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.2K bytes - Viewed (0) -
tests/test_security_http_digest_description.py
security = HTTPDigest(description="HTTPDigest scheme") @app.get("/users/me") def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)): return {"scheme": credentials.scheme, "credentials": credentials.credentials} client = TestClient(app) def test_security_http_digest(): response = client.get("/users/me", headers={"Authorization": "Digest foobar"})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.3K bytes - Viewed (0) -
tests/test_security_api_key_query_description.py
api_key = APIKeyQuery(name="key", description="API Key Query") 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") def read_current_user(current_user: User = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_api_key():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Viewed (0)