Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 275 for beraber (0.87 sec)

  1. tests/test_tutorial/test_security/test_tutorial001_an.py

        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    def test_incorrect_token():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. hack/update-openapi-spec.sh

    rm -fr "${DISCOVERY_ROOT_DIR}"
    mkdir -p "${DISCOVERY_ROOT_DIR}"
    curl -kfsS -H 'Authorization: Bearer dummy_token' -H 'Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList' "https://${API_HOST}:${API_PORT}/apis" | jq -S . > "${DISCOVERY_ROOT_DIR}/aggregated_v2.json"
    
    # Deprecated, remove before v1.33
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 12 17:29:14 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial001_an_py39.py

        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    @needs_py39
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. fastapi/security/http.py

        The first part is the `scheme`, the second part is the `credentials`.
    
        For example, in an HTTP Bearer token scheme, the client will send a header
        like:
    
        ```
        Authorization: Bearer deadbeef12346
        ```
    
        In this case:
    
        * `scheme` will have the value `"Bearer"`
        * `credentials` will have the value `"deadbeef12346"`
        """
    
        scheme: Annotated[
            str,
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Apr 19 15:29:38 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  5. tests/test_security_http_bearer.py

    
    client = TestClient(app)
    
    
    def test_security_http_bearer():
        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Bearer", "credentials": "foobar"}
    
    
    def test_security_http_bearer_no_credentials():
        response = client.get("/users/me")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/text/cases/info.go

    // 1) Implement breaking in separate package.
    // 2) Use the breaker here.
    // 3) Compare table size and performance of using the more generic breaker.
    //
    // Note that we can extend the current algorithm to be much more accurate. This
    // only makes sense, though, if the performance and/or space penalty of using
    // the generic breaker is big. Extra data will only be needed for non-cased
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  7. docs_src/security/tutorial004_an_py39.py

                headers={"WWW-Authenticate": "Bearer"},
            )
        access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
        access_token = create_access_token(
            data={"sub": user.username}, expires_delta=access_token_expires
        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  8. docs_src/security/tutorial004.py

                headers={"WWW-Authenticate": "Bearer"},
            )
        access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
        access_token = create_access_token(
            data={"sub": user.username}, expires_delta=access_token_expires
        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. docs_src/security/tutorial004_an_py310.py

                headers={"WWW-Authenticate": "Bearer"},
            )
        access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
        access_token = create_access_token(
            data={"sub": user.username}, expires_delta=access_token_expires
        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  10. tests/test_security_openid_connect_optional.py

        return current_user
    
    
    client = TestClient(app)
    
    
    def test_security_oauth2():
        response = client.get("/users/me", headers={"Authorization": "Bearer footokenbar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "Bearer footokenbar"}
    
    
    def test_security_oauth2_password_other_header():
        response = client.get("/users/me", headers={"Authorization": "Other footokenbar"})
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.4K bytes
    - Viewed (0)
Back to top