• Stefy Lanza (nextime / spora )'s avatar
    front: enforce the API bearer on /v1, and do not fall open (v0.2.84) · 83bad126
    Stefy Lanza (nextime / spora ) authored
    Reproduced on the published 0.2.83 image, GPU-less, no Authorization header:
    
      GET  /v1/models            -> 200    <- open
      POST /v1/chat/completions  -> 503    (no model in the test, so inconclusive)
      GET  /v1/runpod/spend      -> 502
    
    Nothing returned 401, because the front was never an enforcement point: it
    answers some /v1 paths from its own registry and proxies the rest, so
    whether a request needed a token depended on which component served it. On
    a host published through a reverse proxy that is an open relay for the
    model list, and potentially for generation.
    
    The front now gates /v1 itself with the same credentials the engine
    accepts: the env token a capability image is locked with, the shared
    cluster token a head presents, an API token from auth.json, a logged-in
    browser session, the in-process broker bridge, and the aisbf relay marker.
    Constant-time comparison throughout.
    
    One deliberate difference from the engine's middleware: it does NOT fall
    open when no credentials are configured. That fallback is defensible on a
    loopback workstation and is precisely what exposed this one, so the front
    refuses instead. Readiness and progress endpoints stay exempt — a probe
    that 401s is read as "backend down", and surya-ocr's vLLM client probes
    {service_url}/health.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    83bad126
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-longcat-train.txt Loading commit data...
requirements-longcat.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...