Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 187 for security (0.18 sec)

  1. tests/test_security_oauth2.py

    from dirty_equals import IsDict
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        }
    )
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_optional.py

    from typing import Optional
    
    from dirty_equals import IsDict
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  3. tests/test_security_oauth2_optional_description.py

    from typing import Optional
    
    from dirty_equals import IsDict
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  4. fastapi/openapi/utils.py

            )
            security_name = security_requirement.security_scheme.scheme_name
            security_definitions[security_name] = security_definition
            operation_security.append({security_name: security_requirement.scopes})
        return security_definitions, operation_security
    
    
    def get_openapi_operation_parameters(
        *,
        all_route_params: Sequence[ModelField],
        schema_generator: GenerateJsonSchema,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  5. fastapi/dependencies/utils.py

        dependency: Callable[..., Any],
        path: str,
        name: Optional[str] = None,
        security_scopes: Optional[List[str]] = None,
    ) -> Dependant:
        security_requirement = None
        security_scopes = security_scopes or []
        if isinstance(depends, params.Security):
            dependency_scopes = depends.scopes
            security_scopes.extend(dependency_scopes)
        if isinstance(dependency, SecurityBase):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/security/oauth2-scopes.md

    ```Python hl_lines="155"
    {!../../../docs_src/security/tutorial005.py!}
    ```
    
    ## ๐Ÿ“ฃ โ†” *โžก ๐Ÿ› ๏ธ* & ๐Ÿ”—
    
    ๐Ÿ”œ ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ‘ˆ *โžก ๐Ÿ› ๏ธ* `/users/me/items/` ๐Ÿšš โ†” `items`.
    
    ๐Ÿ‘‰, ๐Ÿ‘ฅ ๐Ÿ—„ & โš™๏ธ `Security` โšช๏ธโžก๏ธ `fastapi`.
    
    ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `Security` ๐Ÿ“ฃ ๐Ÿ”— (๐Ÿ’– `Depends`), โœ‹๏ธ `Security` ๐Ÿ“จ ๐Ÿ”ข `scopes` โฎ๏ธ ๐Ÿ“‡ โ†” (๐ŸŽป).
    
    ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘ฅ ๐Ÿšถโ€โ™€๏ธ ๐Ÿ”— ๐Ÿ”ข `get_current_active_user` `Security` (๐ŸŽ ๐ŸŒŒ ๐Ÿ‘ฅ ๐Ÿ”œ โฎ๏ธ `Depends`).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 11.1K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/security/first-steps.md

        ```Python
        {!> ../../../docs_src/security/tutorial001_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python
        {!> ../../../docs_src/security/tutorial001_an.py!}
        ```
    
    === "Python 3.8+ nicht annotiert"
    
        !!! tip "Tipp"
            Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
    
        ```Python
        {!> ../../../docs_src/security/tutorial001.py!}
        ```
    
    ## Ausfรผhren
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:07:08 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  8. fastapi/security/http.py

        [FastAPI docs for HTTP Basic Auth](https://fastapi.tiangolo.com/advanced/security/http-basic-auth/).
    
        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import HTTPBasic, HTTPBasicCredentials
    
        app = FastAPI()
    
        security = HTTPBasic()
    
    
        @app.get("/users/me")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/security/oauth2-scopes.md

                        * Einen `security_scopes`-Parameter vom Typ `SecurityScopes`:
                            * Dieser `security_scopes`-Parameter hat ein Attribut `scopes` mit einer `list`e, die alle oben deklarierten Scopes enthรคlt, sprich:
                                * `security_scopes.scopes` enthรคlt `["me", "items"]` fรผr die *Pfadoperation* `read_own_items`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:08 GMT 2024
    - 22.8K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/security/oauth2-scopes.md

    For this, we import and use `Security` from `fastapi`.
    
    You can use `Security` to declare dependencies (just like `Depends`), but `Security` also receives a parameter `scopes` with a list of scopes (strings).
    
    In this case, we pass a dependency function `get_current_active_user` to `Security` (the same way we would do with `Depends`).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
Back to top