Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for could (0.16 sec)

  1. tests/test_compat.py

        # For coverage
        # TODO: in theory this would allow declaring types that could be lists of bytes
        # to be read from files and other types, but I'm not even sure it's a good idea
        # to support it as a first class "feature"
        assert is_bytes_sequence_annotation(Union[List[str], List[bytes]])
    
    
    def test_is_uploadfile_sequence_annotation():
        # For coverage
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  2. fastapi/security/oauth2.py

            return data
        ```
    
        Note that for OAuth2 the scope `items:read` is a single scope in an opaque string.
        You could have custom internal logic to separate it by colon caracters (`:`) or
        similar, and get the two parts `items` and `read`. Many applications do that to
        group and organize permissions, you could do it as well in your application, just
        know that that it is application specific, it's not part of the specification.
        """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  3. tests/test_tutorial/test_security/test_tutorial005_an.py

        }
    
    
    def test_incorrect_token():
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    def test_incorrect_token_type():
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  4. docs_src/security/tutorial004.py

        return encoded_jwt
    
    
    async def get_current_user(token: str = Depends(oauth2_scheme)):
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  5. docs_src/security/tutorial004_an.py

        return encoded_jwt
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_py39.py

    @needs_py39
    def test_incorrect_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    @needs_py39
    def test_incorrect_token_type(client: TestClient):
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  7. docs_src/security/tutorial004_an_py310.py

        return encoded_jwt
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  8. docs_src/security/tutorial005_an.py

        else:
            authenticate_value = "Bearer"
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": authenticate_value},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  9. .github/actions/notify-translations/app/main.py

        # Normally only one language, but still
        for lang in langs:
            if lang not in lang_to_discussion_map:
                log_message = f"Could not find discussion for language: {lang}"
                logging.error(log_message)
                raise RuntimeError(log_message)
            discussion = lang_to_discussion_map[lang]
            logging.info(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

    @needs_py39
    def test_incorrect_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    @needs_py39
    def test_incorrect_token_type(client: TestClient):
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
Back to top