Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for fake_users_db (0.04 sec)

  1. docs_src/security/tutorial003_py39.py

    from typing import Union
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from pydantic import BaseModel
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial004_py39.py

    # to get a string like this run:
    # openssl rand -hex 32
    SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
    ALGORITHM = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES = 30
    
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial004.py

        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_verify_password(mod: ModuleType):
        assert mod.verify_password(
            "secret", mod.fake_users_db["johndoe"]["hashed_password"]
        )
    
    
    def test_get_password_hash(mod: ModuleType):
        assert mod.get_password_hash("johndoe")
    
    
    def test_create_access_token(mod: ModuleType):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 13.3K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_security/test_tutorial005.py

        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_verify_password(mod: ModuleType):
        assert mod.verify_password(
            "secret", mod.fake_users_db["johndoe"]["hashed_password"]
        )
    
    
    def test_get_password_hash(mod: ModuleType):
        assert mod.get_password_hash("secretalice")
    
    
    def test_create_access_token(mod: ModuleType):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  5. docs/es/docs/tutorial/security/oauth2-jwt.md

    Y otra más para autenticar y devolver un usuario.
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[8,49,56:57,60:61,70:76] *}
    
    /// note | Nota
    
    Si revisas la nueva (falsa) base de datos `fake_users_db`, verás cómo se ve ahora la contraseña con hash: `"$argon2id$v=19$m=65536,t=3,p=4$wagCPXjifgvUFBzq4hqe3w$CYaIb8sB+wtD+Vu/P4uod1+Qof8h+1g7bbDlBID48Rc"`.
    
    ///
    
    ## Manejo de tokens JWT { #handle-jwt-tokens }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 11.3K bytes
    - Viewed (0)
Back to top