Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 40 for compact (0.19 sec)

  1. tests/test_jsonable_encoder.py

    from datetime import datetime, timezone
    from decimal import Decimal
    from enum import Enum
    from pathlib import PurePath, PurePosixPath, PureWindowsPath
    from typing import Optional
    
    import pytest
    from fastapi._compat import PYDANTIC_V2, Undefined
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel, Field, ValidationError
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    class Person:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/security/http-basic-auth.md

    当然,攻击者不用手动操作,而是编写每秒能执行成千上万次测试的攻击程序,每次都会找到更多正确字符。
    
    但是,在您的应用的**帮助**下,攻击者利用时间差,就能在几分钟或几小时内,以这种方式猜出正确的用户名和密码。
    
    #### 使用 `secrets.compare_digest()` 修补
    
    在此,代码中使用了 `secrets.compare_digest()`。
    
    简单的说,它使用相同的时间对比 `stanleyjobsox` 和 `stanleyjobson`,还有 `johndoe` 和 `stanleyjobson`。对比密码时也一样。
    
    在代码中使用 `secrets.compare_digest()` ,就可以安全地防御全面攻击了。
    
    ### 返回错误
    
    检测到凭证不正确后,返回 `HTTPException` 及状态码 401(与无凭证时返回的内容一样),并添加请求头 `WWW-Authenticate`,让浏览器再次显示登录提示:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:43:48 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  3. docs/fr/docs/python-types.md

    ```
    
    Vous pouvez ensuite déclarer une variable de type `Person` :
    
    ```Python hl_lines="6"
    {!../../../docs_src/python_types/tutorial010.py!}
    ```
    
    Et vous aurez accès, encore une fois, au support complet offert par l'éditeur :
    
    <img src="/img/python-types/image06.png">
    
    ## Les modèles Pydantic
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  4. fastapi/datastructures.py

    from typing import (
        Any,
        BinaryIO,
        Callable,
        Dict,
        Iterable,
        Optional,
        Type,
        TypeVar,
        cast,
    )
    
    from fastapi._compat import (
        PYDANTIC_V2,
        CoreSchema,
        GetJsonSchemaHandler,
        JsonSchemaValue,
        with_info_plain_validator_function,
    )
    from starlette.datastructures import URL as URL  # noqa: F401
    from starlette.datastructures import Address as Address  # noqa: F401
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/metadata.md

    | `contact` | `dict` | 公开的 API 的联系信息。它可以包含多个字段。<details><summary><code>contact</code> 字段</summary><table><thead><tr><th>参数</th><th>Type</th><th>描述</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>str</code></td><td>联系人/组织的识别名称。</td></tr><tr><td><code>url</code></td><td><code>...
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  6. fastapi/dependencies/utils.py

        Dict,
        ForwardRef,
        List,
        Mapping,
        Optional,
        Sequence,
        Tuple,
        Type,
        Union,
        cast,
    )
    
    import anyio
    from fastapi import params
    from fastapi._compat import (
        PYDANTIC_V2,
        ErrorWrapper,
        ModelField,
        Required,
        Undefined,
        _regenerate_error_with_loc,
        copy_field_info,
        create_body_model,
        evaluate_forwardref,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  7. fastapi/encoders.py

    from pydantic import BaseModel
    from pydantic.color import Color
    from pydantic.networks import AnyUrl, NameEmail
    from pydantic.types import SecretBytes, SecretStr
    from typing_extensions import Annotated, Doc
    
    from ._compat import PYDANTIC_V2, UndefinedType, Url, _model_dump
    
    
    # Taken from Pydantic v1 as is
    def isoformat(o: Union[datetime.date, datetime.time]) -> str:
        return o.isoformat()
    
    
    # Taken from Pydantic v1 as is
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  8. docs/pt/docs/alternatives.md

    # Alternativas, Inspiração e Comparações
    
    O que inspirou **FastAPI**, como ele se compara a outras alternativas e o que FastAPI aprendeu delas.
    
    ## Introdução
    
    **FastAPI** não poderia existir se não fosse pelos trabalhos anteriores de outras pessoas.
    
    Houveram tantas ferramentas criadas que ajudaram a inspirar sua criação.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  9. docs/fr/docs/alternatives.md

    # Alternatives, inspiration et comparaisons
    
    Ce qui a inspiré **FastAPI**, comment il se compare à d'autres solutions et ce qu'il en a appris.
    
    ## Intro
    
    **FastAPI** n'existerait pas sans les précédentes contributions d'autres projets.
    
    De nombreux outils ont été créés auparavant et ont contribué à inspirer sa création.
    
    J'ai évité la création d'un nouveau framework pendant plusieurs années. J'ai d'abord essayé de combler toutes les
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27.5K bytes
    - Viewed (0)
  10. fastapi/routing.py

    from typing import (
        Any,
        Callable,
        Coroutine,
        Dict,
        List,
        Optional,
        Sequence,
        Set,
        Tuple,
        Type,
        Union,
    )
    
    from fastapi import params
    from fastapi._compat import (
        ModelField,
        Undefined,
        _get_model_config,
        _model_dump,
        _normalize_errors,
        lenient_issubclass,
    )
    from fastapi.datastructures import Default, DefaultPlaceholder
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
Back to top