Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for UserInDB (0.17 sec)

  1. docs/em/docs/advanced/nosql-databases.md

    ### `User` ๐Ÿท
    
    ๐Ÿฅ‡, โžก๏ธ โœ `User` ๐Ÿท:
    
    ```Python hl_lines="24-28"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    ๐Ÿ‘ฅ ๐Ÿ”œ โš™๏ธ ๐Ÿ‘‰ ๐Ÿท ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข*,, ๐Ÿ‘ฅ ๐Ÿšซ ๐Ÿ”Œ โšซ๏ธ `hashed_password`.
    
    ### `UserInDB` ๐Ÿท
    
    ๐Ÿ”œ, โžก๏ธ โœ `UserInDB` ๐Ÿท.
    
    ๐Ÿ‘‰ ๐Ÿ”œ โœ”๏ธ ๐Ÿ’ฝ ๐Ÿ‘ˆ ๐Ÿค™ ๐Ÿช ๐Ÿ’ฝ.
    
    ๐Ÿ‘ฅ ๐Ÿšซ โœ โšซ๏ธ ๐Ÿฟ Pydantic `BaseModel` โœ‹๏ธ ๐Ÿฟ ๐Ÿ‘† ๐Ÿ‘ `User`, โ†ฉ๏ธ โšซ๏ธ ๐Ÿ”œ โœ”๏ธ ๐ŸŒ ๐Ÿ”ข `User` โž• ๐Ÿ‘ฉโ€โคโ€๐Ÿ‘จ ๐ŸŒ…:
    
    ```Python hl_lines="31-33"
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  2. docs_src/security/tutorial003_an_py39.py

        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    def get_user(db, username: str):
        if username in db:
            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def fake_decode_token(token):
        # This doesn't provide any security at all
        # Check the next version
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  3. docs_src/extra_models/tutorial002_py310.py

        password: str
    
    
    class UserOut(UserBase):
        pass
    
    
    class UserInDB(UserBase):
        hashed_password: str
    
    
    def fake_password_hasher(raw_password: str):
        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 792 bytes
    - Viewed (0)
  4. docs_src/security/tutorial004.py

        username: Union[str, None] = None
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  5. docs_src/security/tutorial004_an.py

        username: Union[str, None] = None
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  6. docs/en/docs/how-to/nosql-databases-couchbase.md

    ```Python hl_lines="24-28"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    We will use this model in our *path operation function*, so, we don't include in it the `hashed_password`.
    
    ### `UserInDB` model
    
    Now, let's create a `UserInDB` model.
    
    This will have the data that is actually stored in the database.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  7. docs_src/extra_models/tutorial002.py

        password: str
    
    
    class UserOut(UserBase):
        pass
    
    
    class UserInDB(UserBase):
        hashed_password: str
    
    
    def fake_password_hasher(raw_password: str):
        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 824 bytes
    - Viewed (0)
  8. docs_src/security/tutorial004_an_py310.py

    class TokenData(BaseModel):
        username: str | None = None
    
    
    class User(BaseModel):
        username: str
        email: str | None = None
        full_name: str | None = None
        disabled: bool | None = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    app = FastAPI()
    
    
    Python
    - Registered: Sun May 05 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

        scopes: List[str] = []
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
    
    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="token",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/security/simple-oauth2.md

    ่ฟ™ๆ ทไธ€ๆฅ๏ผŒ็ชƒ่ดผๅฐฑๆ— ๆณ•ๅœจๅ…ถๅฎƒๅบ”็”จไธญไฝฟ็”จ็ชƒๅ–็š„ๅฏ†็ ๏ผŒ่ฆ็Ÿฅ้“๏ผŒๅพˆๅคš็”จๆˆทๅœจๆ‰€ๆœ‰็ณป็ปŸไธญ้ƒฝไฝฟ็”จ็›ธๅŒ็š„ๅฏ†็ ๏ผŒ้ฃŽ้™ฉ่ถ…ๅคงใ€‚
    
    ```Python hl_lines="80-83"
    {!../../../docs_src/security/tutorial003.py!}
    ```
    
    #### ๅ…ณไบŽ `**user_dict`
    
    `UserInDB(**user_dict)` ๆ˜ฏๆŒ‡๏ผš
    
    *็›ดๆŽฅๆŠŠ `user_dict` ็š„้”ฎไธŽๅ€ผๅฝ“ไฝœๅ…ณ้”ฎๅญ—ๅ‚ๆ•ฐไผ ้€’๏ผŒ็ญ‰ๆ•ˆไบŽ๏ผš*
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
        disabled = user_dict["disabled"],
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.8K bytes
    - Viewed (0)
Back to top