Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 25 of 25 for dhangar (0.09 sec)

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

    <img src="/img/tutorial/security/image11.png">
    
    ## JWT 令牌作用域
    
    现在,修改令牌*路径操作*,返回请求的作用域。
    
    此处仍然使用 `OAuth2PasswordRequestForm`。它包含类型为**字符串列表**的 `scopes` 属性,且`scopes` 属性中包含要在请求里接收的每个作用域。
    
    这样,返回的 JWT 令牌中就包含了作用域。
    
    !!! danger "危险"
    
        为了简明起见,本例把接收的作用域直接添加到了令牌里。
    
        但在您的应用中,为了安全,应该只把作用域添加到确实需要作用域的用户,或预定义的用户。
    
    ```Python hl_lines="153"
    {!../../../docs_src/security/tutorial005.py!}
    ```
    
    ## 在*路径操作*与依赖项中声明作用域
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 22:43:35 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  2. docs/fr/docs/python-types.md

    Mais malheureusement, rien d'utile n'en résulte :
    
    <img src="/img/python-types/image01.png">
    
    ### Ajouter des types
    
    Modifions une seule ligne de la version précédente.
    
    Nous allons changer seulement cet extrait, les paramètres de la fonction, de :
    
    
    ```Python
        first_name, last_name
    ```
    
    à :
    
    ```Python
        first_name: str, last_name: str
    ```
    
    C'est tout.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/response-model.md

    ```Python hl_lines="17-18"
    {!../../../docs_src/response_model/tutorial002.py!}
    ```
    
    现在,每当浏览器使用一个密码创建用户时,API 都会在响应中返回相同的密码。
    
    在这个案例中,这可能不算是问题,因为用户自己正在发送密码。
    
    但是,如果我们在其他的*路径操作*中使用相同的模型,则可能会将用户的密码发送给每个客户端。
    
    !!! danger
        永远不要存储用户的明文密码,也不要在响应中发送密码。
    
    ## 添加输出模型
    
    相反,我们可以创建一个有明文密码的输入模型和一个没有明文密码的输出模型:
    
    === "Python 3.10+"
    
        ```Python hl_lines="9  11  16"
        {!> ../../../docs_src/response_model/tutorial003_py310.py!}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  4. docs/fr/docs/index.md

    * Fournir directement 2 interfaces web de documentation interactive.
    
    ---
    
    Nous n'avons fait qu'effleurer la surface, mais vous avez déjà une idée de la façon dont tout cela fonctionne.
    
    Essayez de changer la ligne contenant :
    
    ```Python
        return {"item_name": item.name, "item_id": item_id}
    ```
    
    ... de :
    
    ```Python
            ... "item_name": item.name ...
    ```
    
    ... vers :
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon Apr 29 05:18:04 UTC 2024
    - 22K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/security/oauth2-scopes.md

    We are still using the same `OAuth2PasswordRequestForm`. It includes a property `scopes` with a `list` of `str`, with each scope it received in the request.
    
    And we return the scopes as part of the JWT token.
    
    !!! danger
        For simplicity, here we are just adding the scopes received directly to the token.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 20.5K bytes
    - Viewed (0)
Back to top