Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,141 for Scheme (0.16 sec)

  1. okhttp/src/test/java/okhttp3/WebPlatformUrlTest.kt

      @ArgumentsSource(TestDataParamProvider::class)
      @ParameterizedTest
      fun httpUrl(testData: WebPlatformUrlTestData) {
        if (!testData.scheme.isEmpty() && !HTTP_URL_SCHEMES.contains(testData.scheme)) {
          System.err.println("Ignoring unsupported scheme ${testData.scheme}")
          return
        }
    
        if (!testData.base!!.startsWith("https:") &&
          !testData.base!!.startsWith("http:") &&
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  2. tests/test_security_http_digest_optional.py

            return {"msg": "Create an account first"}
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_digest():
        response = client.get("/users/me", headers={"Authorization": "Digest foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Digest", "credentials": "foobar"}
    
    
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  3. tests/test_security_http_base.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_base():
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  4. tests/test_security_http_base_optional.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other", auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(
        credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
    ):
        if credentials is None:
            return {"msg": "Create an account first"}
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  5. tests/test_security_http_bearer.py

        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    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"}
    
    
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  6. tests/test_security_http_bearer_description.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBearer(description="HTTP Bearer token scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_bearer():
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. tests/test_security_http_digest_description.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPDigest(description="HTTPDigest scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_digest():
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  8. fastapi/security/http.py

        ):
            self.model = HTTPBaseModel(scheme=scheme, description=description)
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        async def __call__(
            self, request: Request
        ) -> Optional[HTTPAuthorizationCredentials]:
            authorization = request.headers.get("Authorization")
            scheme, credentials = get_authorization_scheme_param(authorization)
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. fastapi/security/api_key.py

        app = FastAPI()
    
        query_scheme = APIKeyQuery(name="api_key")
    
    
        @app.get("/items/")
        async def read_items(api_key: str = Depends(query_scheme)):
            return {"api_key": api_key}
        ```
        """
    
        def __init__(
            self,
            *,
            name: Annotated[
                str,
                Doc("Query parameter name."),
            ],
            scheme_name: Annotated[
                Optional[str],
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  10. fastapi/security/open_id_connect_url.py

                str,
                Doc(
                    """
                The OpenID Connect URL.
                """
                ),
            ],
            scheme_name: Annotated[
                Optional[str],
                Doc(
                    """
                    Security scheme name.
    
                    It will be included in the generated OpenAPI (e.g. visible at `/docs`).
                    """
                ),
            ] = None,
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
Back to top