Skip to main content

Crate sloc_web

Crate sloc_web 

Source

Structs§

AuditVerifyReport
Outcome of verifying a tamper-evident audit log.

Constants§

TEST_SERVER_MODE_API_KEY
Bearer token used by make_test_router_server_mode() test routers. Tests that exercise server-mode paths must include this key in their requests.

Functions§

build_sub_run
make_test_router
Build a minimal router suitable for integration tests — no TCP binding, no API keys, no TLS.
make_test_router_exhausted_semaphore
Test router where the analysis semaphore is pre-exhausted (0 permits). Immediately returns 503 on POST /analyze, exercising the busy-server branch.
make_test_router_server_mode
Test router with server_mode = true. Exercises server-mode-gated code paths such as the locked watched-bar in trend-reports, path validation in analyze, and upload-only preview restrictions.
make_test_router_server_mode_with_roots
Server-mode test router with allowed_scan_roots configured.
make_test_router_tight_auth_lockout
Test router with a very tight auth lockout (threshold=2, window=200ms). Used by tests that need to trigger and verify the auth lockout response.
make_test_router_tight_rate_limit
Test router with a very tight rate limit (3 req/min). The third request from the same IP (0.0.0.0 when ConnectInfo is absent) returns 429.
make_test_router_with_key
Test router with one API key pre-loaded. Used by auth integration tests.
sanitize_project_label
serve
Errors
verify_audit_file
Verify a hash-chained audit log written with SLOC_AUDIT_HMAC_KEY.