Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 97 for wsScheme (0.12 sec)

  1. 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)
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. 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():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  3. 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():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/Challenge.kt

        authParams["charset"] = charset.name()
        return Challenge(scheme, authParams)
      }
    
      @JvmName("-deprecated_scheme")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "scheme"),
        level = DeprecationLevel.ERROR,
      )
      fun scheme(): String = scheme
    
      @JvmName("-deprecated_authParams")
      @Deprecated(
        message = "moved to val",
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. tests/test_security_http_digest.py

        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"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt

          }
        return response.request.newBuilder()
          .addHeader(header, credential)
          .build()
      }
    
      private fun schemeMatches(response: Response): Boolean {
        if (scheme == null) return true
        return response.challenges().any { it.scheme.equals(scheme, ignoreCase = true) }
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. 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:") &&
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  8. 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():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  9. tests/test_security_http_base_description.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other", description="Other Security 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_base():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  10. internal/handlers/proxy.go

    	// prefixed by 'proto='. The match is case-insensitive.
    	protoRegex = regexp.MustCompile(`(?i)^(;|,| )+(?:proto=)(https|http)`)
    )
    
    // GetSourceScheme retrieves the scheme from the X-Forwarded-Proto and RFC7239
    // Forwarded headers (in that order).
    func GetSourceScheme(r *http.Request) string {
    	var scheme string
    
    	// Retrieve the scheme from X-Forwarded-Proto.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Dec 22 00:56:55 UTC 2023
    - 5.1K bytes
    - Viewed (0)
Back to top