Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for escopos (0.04 sec)

  1. tests/test_security_oauth2_optional.py

    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"},
            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  2. tests/test_security_oauth2.py

    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"},
            }
        }
    )
    
    
    class User(BaseModel):
        username: str
    
    
    # Here we use string annotations to test them
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9K bytes
    - Viewed (0)
  3. tests/test_security_oauth2_optional_description.py

    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"},
            }
        },
        description="OAuth2 security scheme",
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.1K bytes
    - Viewed (0)
  4. fastapi/param_functions.py

        @app.get("/users/me/items/")
        async def read_own_items(
            current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
        ):
            return [{"item_id": "Foo", "owner": current_user.username}]
        ```
        """
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 63K bytes
    - Viewed (0)
  5. fastapi/dependencies/utils.py

            "A parameter-less dependency must have a callable dependency"
        )
        own_oauth_scopes: list[str] = []
        if isinstance(depends, params.Security) and depends.scopes:
            own_oauth_scopes.extend(depends.scopes)
        return get_dependant(
            path=path,
            call=depends.dependency,
            scope=depends.scope,
            own_oauth_scopes=own_oauth_scopes,
        )
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  6. tests/test_tutorial/test_security/test_tutorial003.py

                        },
                    },
                },
                "securitySchemes": {
                    "OAuth2PasswordBearer": {
                        "type": "oauth2",
                        "flows": {"password": {"scopes": {}, "tokenUrl": "token"}},
                    }
                },
            },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.7K bytes
    - Viewed (0)
  7. fastapi/openapi/utils.py

                    operation_security_dict[security_name].append(scope)
        operation_security = [
            {name: scopes} for name, scopes in operation_security_dict.items()
        ]
        return security_definitions, operation_security
    
    
    def _get_openapi_operation_parameters(
        *,
        dependant: Dependant,
        model_name_map: ModelNameMap,
        field_mapping: dict[
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial005.py

                        "OAuth2PasswordBearer": {
                            "type": "oauth2",
                            "flows": {
                                "password": {
                                    "scopes": {
                                        "me": "Read information about the current user.",
                                        "items": "Read items.",
                                    },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  9. fastapi/params.py

    class Depends:
        dependency: Optional[Callable[..., Any]] = None
        use_cache: bool = True
        scope: Union[Literal["function", "request"], None] = None
    
    
    @dataclass(frozen=True)
    class Security(Depends):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 26.3K bytes
    - Viewed (0)
  10. fastapi/openapi/models.py

    
    class HTTPBearer(HTTPBase):
        scheme: Literal["bearer"] = "bearer"
        bearerFormat: Optional[str] = None
    
    
    class OAuthFlow(BaseModelWithConfig):
        refreshUrl: Optional[str] = None
        scopes: dict[str, str] = {}
    
    
    class OAuthFlowImplicit(OAuthFlow):
        authorizationUrl: str
    
    
    class OAuthFlowPassword(OAuthFlow):
        tokenUrl: str
    
    
    class OAuthFlowClientCredentials(OAuthFlow):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
Back to top