• Stefy Lanza (nextime / spora )'s avatar
    broker: don't require an end-user Bearer token for AISBF-relayed requests · 6e111277
    Stefy Lanza (nextime / spora ) authored
    Broker (AISBF) chat requests were rejected by the engine with 401 "Invalid API
    key" — they're authenticated at the aisbf layer (registration token) and carry no
    end-user Bearer, but the engine's BearerAuthMiddleware still demanded one, so every
    brokered request came back as a constant ~472-byte error and never ran inference.
    
    Fix (token auto-managed, secure):
    - Front marks broker-relayed requests with x-coderai-broker-authed = the internal
      shared token (which the engine already trusts via CODERAI_INTERNAL_TOKEN). Added
      that header to _DROP_REQ so a client-supplied copy is always stripped first —
      unforgeable from outside.
    - Engine BearerAuthMiddleware skips the Bearer check when x-coderai-broker-authed
      matches CODERAI_INTERNAL_TOKEN. This is NOT the plain internal token (which rides
      on every front→engine request, direct included), so DIRECT API requests still
      require a real Bearer token.
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    6e111277
Name
Last commit
Last update
..
__init__.py Loading commit data...
_film_net.py Loading commit data...
_rife_ifnet.py Loading commit data...
app.py Loading commit data...
archive.py Loading commit data...
audio_backends.py Loading commit data...
audio_clean.py Loading commit data...
audio_gen.py Loading commit data...
audio_stems.py Loading commit data...
characters.py Loading commit data...
custom_pipelines.py Loading commit data...
ds4_kv_janitor.py Loading commit data...
ds4_worker.py Loading commit data...
embeddings.py Loading commit data...
environments.py Loading commit data...
faceswap.py Loading commit data...
images.py Loading commit data...
log.py Loading commit data...
loras.py Loading commit data...
parler_worker.py Loading commit data...
pipelines.py Loading commit data...
prompt_cache.py Loading commit data...
ratelimit.py Loading commit data...
spatial.py Loading commit data...
state.py Loading commit data...
text.py Loading commit data...
transcriptions.py Loading commit data...
tts.py Loading commit data...
tts_backends.py Loading commit data...
urlutils.py Loading commit data...
video.py Loading commit data...
voice_clone.py Loading commit data...
voice_convert.py Loading commit data...