Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 70 for Hash (0.21 sec)

  1. docs_src/security/tutorial004_py310.py

    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:
            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/extra-models.md

    !!! danger "Gefahr"
        Speichern Sie niemals das Klartext-Passwort eines Benutzers. Speichern Sie immer den „sicheren Hash“, den Sie verifizieren können.
    
        Falls Ihnen das nichts sagt, in den [Sicherheits-Kapiteln](security/simple-oauth2.md#passwort-hashing){.internal-link target=_blank} werden Sie lernen, was ein „Passwort-Hash“ ist.
    
    ## Mehrere Modelle
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

        assert verify_password("secret", fake_users_db["johndoe"]["hashed_password"])
    
    
    @needs_py39
    def test_get_password_hash():
        from docs_src.security.tutorial005_an_py39 import get_password_hash
    
        assert get_password_hash("secretalice")
    
    
    @needs_py39
    def test_create_access_token():
        from docs_src.security.tutorial005_an_py39 import create_access_token
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_security/test_tutorial005_py310.py

        assert verify_password("secret", fake_users_db["johndoe"]["hashed_password"])
    
    
    @needs_py310
    def test_get_password_hash():
        from docs_src.security.tutorial005_py310 import get_password_hash
    
        assert get_password_hash("secretalice")
    
    
    @needs_py310
    def test_create_access_token():
        from docs_src.security.tutorial005_py310 import create_access_token
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  5. docs/ja/docs/advanced/nosql-databases.md

    例えば`dict`が下記のようになっていた場合:
    
    ```Python
    {
        "username": "johndoe",
        "hashed_password": "some_hash",
    }
    ```
    
    `UserInDB`には次のように渡されます:
    
    ```Python
    UserInDB(username="johndoe", hashed_password="some_hash")
    ```
    
    ## **FastAPI** コードの実装
    
    ### `FastAPI` app の作成
    
    ```Python hl_lines="46"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Thu Aug 18 15:54:22 GMT 2022
    - 7K bytes
    - Viewed (0)
  6. docs_src/security/tutorial003_an.py

            "full_name": "Alice Wonderson",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
        return "fakehashed" + password
    
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  7. docs_src/security/tutorial003_an_py310.py

            "full_name": "Alice Wonderson",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
        return "fakehashed" + password
    
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    class User(BaseModel):
        username: str
        email: str | None = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  8. docs_src/security/tutorial003_py310.py

            "full_name": "Alice Wonderson",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
        return "fakehashed" + password
    
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    class User(BaseModel):
        username: str
        email: str | None = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  9. tests/test_response_model_as_return_annotation.py

        return DBUser(name="John", surname="Doe", password_hash="secret")
    
    
    @app.get("/response_model_list_of_model-no_annotation", response_model=List[User])
    def response_model_list_of_model_no_annotation():
        return [
            DBUser(name="John", surname="Doe", password_hash="secret"),
            DBUser(name="Jane", surname="Does", password_hash="secret2"),
        ]
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Aug 14 09:49:57 GMT 2023
    - 47.7K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/extra-models.md

        {!> ../../../docs_src/extra_models/tutorial005.py!}
        ```
    
    ## 小结
    
    针对不同场景,可以随意使用不同的 Pydantic 模型继承定义的基类。
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Apr 01 01:15:53 GMT 2024
    - 6.7K bytes
    - Viewed (0)
Back to top