Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for Clain (0.17 sec)

  1. docs_src/security/tutorial004.py

    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    def verify_password(plain_password, hashed_password):
        return pwd_context.verify(plain_password, hashed_password)
    
    
    def get_password_hash(password):
        return pwd_context.hash(password)
    
    
    def get_user(db, username: str):
        if username in db:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial004_an.py

    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    def verify_password(plain_password, hashed_password):
        return pwd_context.verify(plain_password, hashed_password)
    
    
    def get_password_hash(password):
        return pwd_context.hash(password)
    
    
    def get_user(db, username: str):
        if username in db:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  3. tests/test_compat.py

        # For coverage
        field_info = FieldInfo(annotation=str)
        field = ModelField(name="foo", field_info=field_info)
        assert field.default is Undefined
    
    
    @needs_pydanticv1
    def test_upload_file_dummy_with_info_plain_validator_function():
        # For coverage
        assert UploadFile.__get_pydantic_core_schema__(str, lambda x: None) == {}
    
    
    @needs_pydanticv1
    def test_union_scalar_list():
        # For coverage
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/path-operation-advanced-configuration.md

    ```Python hl_lines="20-37  39-40"
    {!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
    ```
    
    👉 🖼, 👥 🚫 📣 🙆 Pydantic 🏷. 👐, 📨 💪 🚫 <abbr title="converted from some plain format, like bytes, into Python objects">🎻</abbr> 🎻, ⚫️ ✍ 🔗 `bytes`, &amp; 🔢 `magic_data_reader()` 🔜 🈚 🎻 ⚫️ 🌌.
    
    👐, 👥 💪 📣 📈 🔗 📨 💪.
    
    ### 🛃 🗄 🎚 🆎
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body/test_tutorial001.py

            "tax": None,
        }
    
    
    def test_wrong_headers(client: TestClient):
        data = '{"name": "Foo", "price": 50.5}'
        response = client.post(
            "/items/", content=data, headers={"Content-Type": "text/plain"}
        )
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "model_attributes_type",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (4)
  6. tests/test_tutorial/test_body/test_tutorial001_py310.py

        }
    
    
    @needs_py310
    def test_wrong_headers(client: TestClient):
        data = '{"name": "Foo", "price": 50.5}'
        response = client.post(
            "/items/", content=data, headers={"Content-Type": "text/plain"}
        )
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "model_attributes_type",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  7. docs/en/docs/tutorial/response-model.md

    But if we use the same model for another *path operation*, we could be sending our user's passwords to every client.
    
    !!! danger
        Never store the plain password of a user or send it in a response like this, unless you know all the caveats and you know what you are doing.
    
    ## Add an output model
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  8. docs_src/security/tutorial004_an_py310.py

    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    def verify_password(plain_password, hashed_password):
        return pwd_context.verify(plain_password, hashed_password)
    
    
    def get_password_hash(password):
        return pwd_context.hash(password)
    
    
    def get_user(db, username: str):
        if username in db:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  9. docs_src/security/tutorial005_an.py

    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="token",
        scopes={"me": "Read information about the current user.", "items": "Read items."},
    )
    
    app = FastAPI()
    
    
    def verify_password(plain_password, hashed_password):
        return pwd_context.verify(plain_password, hashed_password)
    
    
    def get_password_hash(password):
        return pwd_context.hash(password)
    
    
    def get_user(db, username: str):
        if username in db:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py

                data={"token": "foo"},
                files={"file": filea, "fileb": ("testb.txt", fileb, "text/plain")},
            )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "file_size": 14,
            "token": "foo",
            "fileb_content_type": "text/plain",
        }
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
Back to top