Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for UserName (0.23 sec)

  1. docs/em/docs/advanced/security/oauth2-scopes.md

    {!../../../docs_src/security/tutorial005.py!}
    ```
    
    ## ✔ `username` & 💽 💠
    
    👥 ✔ 👈 👥 🤚 `username`, & ⚗ ↔.
    
    & ⤴️ 👥 ✔ 👈 📊 ⏮️ Pydantic 🏷 (✊ `ValidationError` ⚠), & 🚥 👥 🤚 ❌ 👂 🥙 🤝 ⚖️ ⚖ 📊 ⏮️ Pydantic, 👥 🤚 `HTTPException` 👥 ✍ ⏭.
    
    👈, 👥 ℹ Pydantic 🏷 `TokenData` ⏮️ 🆕 🏠 `scopes`.
    
    ⚖ 📊 ⏮️ Pydantic 👥 💪 ⚒ 💭 👈 👥 ✔️, 🖼, ⚫️❔ `list` `str` ⏮️ ↔ & `str` ⏮️ `username`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 11.1K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/security/oauth2-scopes.md

            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="105  107-115"
        {!> ../../../docs_src/security/tutorial005.py!}
        ```
    
    ## Verify the `username` and data shape
    
    We verify that we get a `username`, and extract the scopes.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/security/oauth2-scopes.md

    {!../../../docs_src/security/tutorial005.py!}
    ```
    
    ## 校验 `username` 与数据形状
    
    我们可以校验是否获取了 `username`,并抽取作用域。
    
    然后,使用 Pydantic 模型校验数据(捕获 `ValidationError` 异常),如果读取 JWT 令牌或使用 Pydantic 模型验证数据时出错,就会触发之前创建的 `HTTPException` 异常。
    
    对此,要使用新的属性 `scopes` 更新 Pydantic 模型 `TokenData`。
    
    使用 Pydantic 验证数据可以确保数据中含有由作用域组成的**字符串列表**,以及 `username` 字符串等内容。
    
    反之,如果使用**字典**或其它数据结构,就有可能在后面某些位置破坏应用,形成安全隐患。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:43:35 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/security/oauth2-scopes.md

        ```Python hl_lines="105  107-115"
        {!> ../../../docs_src/security/tutorial005.py!}
        ```
    
    ## Den `username` und das Format der Daten überprüfen
    
    Wir verifizieren, dass wir einen `username` erhalten, und extrahieren die Scopes.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:08 GMT 2024
    - 22.8K bytes
    - Viewed (0)
Back to top