Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 81 - 90 of 868 for users2 (0.09 seconds)

  1. tests/test_security_http_digest_description.py

    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():
        response = client.get("/users/me", headers={"Authorization": "Digest foobar"})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  2. tests/test_security_http_bearer_description.py

    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():
        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  3. .ci/scripts/packaging-test.ps1

    $ErrorActionPreference="Stop"
    $gradleInit = "C:\Users\$env:username\.gradle\init.d\"
    echo "Remove $gradleInit"
    Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore
    New-Item -ItemType directory -Path $gradleInit
    echo "Copy .ci/init.gradle to $gradleInit"
    Copy-Item .ci/init.gradle -Destination $gradleInit
    
    [Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
    $env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH"
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Tue Jun 15 22:00:26 GMT 2021
    - 1.3K bytes
    - Click Count (0)
  4. tests/test_security_http_base_optional.py

    client = TestClient(app)
    
    
    def test_security_http_base():
        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Other", "credentials": "foobar"}
    
    
    def test_security_http_base_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2K bytes
    - Click Count (0)
  5. tests/update_has_many_test.go

    		CheckUser(t, user2, user)
    
    		for idx := range user.Toys {
    			user.Toys[idx].Name += "new"
    		}
    
    		if err := DB.Save(&user).Error; err != nil {
    			t.Fatalf("errors happened when update: %v", err)
    		}
    
    		var user3 User
    		DB.Preload("Toys").Find(&user3, "id = ?", user.ID)
    		CheckUser(t, user2, user3)
    
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2K bytes
    - Click Count (0)
  6. tests/test_security_api_key_query_description.py

    app = FastAPI()
    
    api_key = APIKeyQuery(name="key", description="API Key Query")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    client = TestClient(app)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2.2K bytes
    - Click Count (0)
  7. tests/test_security_api_key_query_optional.py

    api_key = APIKeyQuery(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str | None = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User | None = Depends(get_current_user)):
        if current_user is None:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  8. docs/en/docs/tutorial/bigger-applications.md

    ### Include the `APIRouter`s for `users` and `items` { #include-the-apirouters-for-users-and-items }
    
    Now, let's include the `router`s from the submodules `users` and `items`:
    
    {* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *}
    
    /// info
    
    `users.router` contains the `APIRouter` inside of the file `app/routers/users.py`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 07 09:29:03 GMT 2026
    - 19.2K bytes
    - Click Count (0)
  9. .ci/os.ps1

    $ErrorActionPreference="Stop"
    $gradleInit = "C:\Users\$env:username\.gradle\init.d\"
    echo "Remove $gradleInit"
    Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore
    New-Item -ItemType directory -Path $gradleInit
    echo "Copy .ci/init.gradle to $gradleInit"
    Copy-Item .ci/init.gradle -Destination $gradleInit
    
    [Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
    $env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH"
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Wed Jul 08 20:49:46 GMT 2020
    - 1.3K bytes
    - Click Count (0)
  10. tests/test_security_api_key_cookie_optional.py

    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str | None = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        if current_user is None:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.2K bytes
    - Click Count (0)
Back to Top