Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 42 for advice (0.16 sec)

  1. docs/em/docs/tutorial/security/simple-oauth2.md

    ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ–Š ๐Ÿ”’ โ„น & โ, & โคด๏ธ ๐Ÿ”„ ๐ŸŽ ๐Ÿ› ๏ธ ๐Ÿ”„, ๐Ÿ‘† ๐Ÿ”œ ๐Ÿคš ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” 4๏ธโƒฃ0๏ธโƒฃ1๏ธโƒฃ โŒ:
    
    ```JSON
    {
      "detail": "Not authenticated"
    }
    ```
    
    ### ๐Ÿ”• ๐Ÿ‘ฉโ€๐Ÿ’ป
    
    ๐Ÿ”œ ๐Ÿ”„ โฎ๏ธ ๐Ÿ”• ๐Ÿ‘ฉโ€๐Ÿ’ป, ๐Ÿ”“ โฎ๏ธ:
    
    ๐Ÿ‘ฉโ€๐Ÿ’ป: `alice`
    
    ๐Ÿ”: `secret2`
    
    & ๐Ÿ”„ โš™๏ธ ๐Ÿ› ๏ธ `GET` โฎ๏ธ โžก `/users/me`.
    
    ๐Ÿ‘† ๐Ÿ”œ ๐Ÿคš "๐Ÿ”• ๐Ÿ‘ฉโ€๐Ÿ’ป" โŒ, ๐Ÿ’–:
    
    ```JSON
    {
      "detail": "Inactive user"
    }
    ```
    
    ## ๐ŸŒƒ
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  2. docs_src/security/tutorial003.py

            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Wonderson",
            "email": "alice@example.com",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  3. tests/test_dependency_security_overrides.py

    app = FastAPI()
    
    
    def get_user(required_scopes: SecurityScopes):
        return "john", required_scopes.scopes
    
    
    def get_user_override(required_scopes: SecurityScopes):
        return "alice", required_scopes.scopes
    
    
    def get_data():
        return [1, 2, 3]
    
    
    def get_data_override():
        return [3, 4, 5]
    
    
    @app.get("/user")
    def read_user(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jun 14 15:54:46 GMT 2020
    - 1.4K bytes
    - Viewed (0)
  4. docs_src/security/tutorial005_py310.py

            "email": "******@****.***",
            "hashed_password": "$2b$12$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Chains",
            "email": "******@****.***",
            "hashed_password": "$2b$12$gSvqqUPvlXP2tfVFaWK1Be7DlH.PKZbv5H8KnzzVgXXbVxpva.pFm",
            "disabled": True,
        },
    }
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  5. docs_src/security/tutorial005_an_py310.py

            "email": "******@****.***",
            "hashed_password": "$2b$12$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Chains",
            "email": "******@****.***",
            "hashed_password": "$2b$12$gSvqqUPvlXP2tfVFaWK1Be7DlH.PKZbv5H8KnzzVgXXbVxpva.pFm",
            "disabled": True,
        },
    }
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial001_py39.py

        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
                "description": "Device to travel through the multi-rick-verse",
            },
            {"name": "Plumbus", "description": None},
        ]
    
    
    @needs_py39
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient) -> None:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial003_an_py310.py

        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py310
    def test_inactive_user(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer alice"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Inactive user"}
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial003_py310.py

        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py310
    def test_inactive_user(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer alice"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Inactive user"}
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  9. docs/es/docs/tutorial/path-params.md

    ```
    /files/{file_path:path}
    ```
    
    En este caso el nombre del parรกmetro es `file_path` y la รบltima parte, `:path`, le dice que el parรกmetro deberรญa coincidir con cualquier path.
    
    Entonces lo puedes usar con:
    
    ```Python hl_lines="6"
    {!../../../docs_src/path_params/tutorial004.py!}
    ```
    
    !!! tip "Consejo"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  10. docs_src/separate_openapi_schemas/tutorial002_py39.py

    @app.post("/items/")
    def create_item(item: Item):
        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
                description="Device to travel through the multi-rick-verse",
            ),
            Item(name="Plumbus"),
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 518 bytes
    - Viewed (0)
Back to top