- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for security (0.28 sec)
-
docs/zh/docs/tutorial/security/oauth2-jwt.md
定义令牌端点响应的 Pydantic 模型。 创建生成新的访问令牌的工具函数。 ```Python hl_lines="6 12-14 28-30 78-86" {!../../../docs_src/security/tutorial004.py!} ``` ## 更新依赖项 更新 `get_current_user` 以接收与之前相同的令牌,但这里用的是 JWT 令牌。 解码并校验接收到的令牌,然后,返回当前用户。 如果令牌无效,则直接返回 HTTP 错误。 ```Python hl_lines="89-106" {!../../../docs_src/security/tutorial004.py!} ``` ## 更新 `/token` *路径操作* 用令牌过期时间创建 `timedelta` 对象。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 21:21:35 GMT 2024 - 9.2K bytes - Viewed (0) -
docs/de/docs/tutorial/security/oauth2-jwt.md
{!> ../../../docs_src/security/tutorial004_an_py310.py!} ``` === "Python 3.9+" ```Python hl_lines="7 48 55-56 59-60 69-75" {!> ../../../docs_src/security/tutorial004_an_py39.py!} ``` === "Python 3.8+" ```Python hl_lines="7 49 56-57 60-61 70-76" {!> ../../../docs_src/security/tutorial004_an.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:27:06 GMT 2024 - 15.1K bytes - Viewed (0) -
docs/em/docs/tutorial/security/oauth2-jwt.md
=== "🐍 3️⃣.6️⃣ & 🔛" ```Python hl_lines="7 48 55-56 59-60 69-75" {!> ../../../docs_src/security/tutorial004.py!} ``` === "🐍 3️⃣.1️⃣0️⃣ & 🔛" ```Python hl_lines="6 47 54-55 58-59 68-74" {!> ../../../docs_src/security/tutorial004_py310.py!} ``` !!! note
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 21:21:35 GMT 2024 - 9.5K bytes - Viewed (0) -
docs/en/docs/tutorial/security/oauth2-jwt.md
{!> ../../../docs_src/security/tutorial004_an_py310.py!} ``` === "Python 3.9+" ```Python hl_lines="7 48 55-56 59-60 69-75" {!> ../../../docs_src/security/tutorial004_an_py39.py!} ``` === "Python 3.8+" ```Python hl_lines="7 49 56-57 60-61 70-76" {!> ../../../docs_src/security/tutorial004_an.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 13K bytes - Viewed (0) -
docs/ja/docs/tutorial/security/oauth2-jwt.md
新しいアクセストークンを生成するユーティリティ関数を作成します。 ```Python hl_lines="6 12-14 28-30 78-86" {!../../../docs_src/security/tutorial004.py!} ``` ## 依存関係の更新 `get_current_user`を更新して、先ほどと同じトークンを受け取るようにしますが、今回はJWTトークンを使用します。 受け取ったトークンを復号して検証し、現在のユーザーを返します。 トークンが無効な場合は、すぐにHTTPエラーを返します。 ```Python hl_lines="89-106" {!../../../docs_src/security/tutorial004.py!} ``` ## `/token` パスオペレーションの更新 トークンの有効期限を表す`timedelta`を作成します。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 21:21:35 GMT 2024 - 14.1K bytes - Viewed (0)