- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 157 for torrent (0.29 sec)
-
docs/ja/docs/tutorial/security/get-current-user.md
```Python hl_lines="5 12-16" {!../../../docs_src/security/tutorial002.py!} ``` ## 依存関係 `get_current_user` を作成 依存関係 `get_current_user` を作ってみましょう。 依存関係はサブ依存関係を持つことができるのを覚えていますか? `get_current_user` は前に作成した `oauth2_scheme` と同じ依存関係を持ちます。 以前直接 *path operation* の中でしていたのと同じように、新しい依存関係である `get_current_user` は `str` として `token` を受け取るようになります: ```Python hl_lines="25" {!../../../docs_src/security/tutorial002.py!} ```
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Jan 28 18:36:35 GMT 2024 - 5.6K bytes - Viewed (0) -
docs_src/security/tutorial004_py310.py
@app.get("/users/me/", response_model=User) async def read_users_me(current_user: User = Depends(get_current_active_user)): return current_user @app.get("/users/me/items/") async def read_own_items(current_user: User = Depends(get_current_active_user)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4K bytes - Viewed (0) -
tests/test_security_api_key_cookie_optional.py
class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(api_key)): if oauth_header is None: return None user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"} else:
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/test_security_openid_connect_optional.py
class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(oid)): if oauth_header is None: return None user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: Optional[User] = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.4K bytes - Viewed (0) -
tests/test_security_api_key_query.py
api_key = APIKeyQuery(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") 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 Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.8K bytes - Viewed (0) -
tests/test_security_api_key_cookie_description.py
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 def test_security_api_key(): client = TestClient(app, cookies={"key": "secret"})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/test_security_http_basic_optional.py
"content": {"application/json": {"schema": {}}}, } }, "summary": "Read Current User", "operationId": "read_current_user_users_me_get", "security": [{"HTTPBasic": []}], } } }, "components": {
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) -
tests/test_security_http_basic_realm.py
"content": {"application/json": {"schema": {}}}, } }, "summary": "Read Current User", "operationId": "read_current_user_users_me_get", "security": [{"HTTPBasic": []}], } } }, "components": {
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) -
tests/test_tutorial/test_security/test_tutorial006.py
"content": {"application/json": {"schema": {}}}, } }, "summary": "Read Current User", "operationId": "read_current_user_users_me_get", "security": [{"HTTPBasic": []}], } } }, "components": {
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) -
docs/en/docs/advanced/additional-responses.md
The correct place is: * In the key `content`, that has as value another JSON object (`dict`) that contains: * A key with the media type, e.g. `application/json`, that contains as value another JSON object, that contains: * A key `schema`, that has as the value the JSON Schema from the model, here's the correct place.
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 8.8K bytes - Viewed (0)