Skip to content

[Docs]: Missing Documentation for INTERNAL_RAG_TOKEN Protected Endpoint Model #579

Description

@Srejoye

Summary

Description

rag-service/main.py defines two protection mechanisms — an exact-match set (PROTECTED_RAG_PATHS) and a prefix set (PROTECTED_RAG_PREFIXES) — that gate service-to-service access via the X-Internal-Token header. However, neither README.md, .env.example, nor any inline documentation explains:

  • Which endpoints are protected and why the split between exact-match and prefix exists.
  • What happens when INTERNAL_RAG_TOKEN is absent (503 is returned, but this is only discoverable by reading the middleware source).
  • That the RAG service must not be exposed on a public port — the middleware comment says "when port 5000 is accidentally exposed" but no deployment guide reinforces this.
  • That adding a new route under /ask/ is automatically protected, while a new top-level route (e.g. /ask-v2) is not — operators extending the API have no way to discover this without reading internal_auth_middleware.

docker-compose.yml does not bind the RAG service port to localhost only, so a developer standing up the stack locally exposes port 5000 publicly on their machine with no documentation warning.

Affected Files

  • README.md — no section on service-to-service auth or port exposure
  • .env.exampleINTERNAL_RAG_TOKEN listed but not explained
  • rag-service/main.py lines 556–603 (PROTECTED_RAG_PATHS, PROTECTED_RAG_PREFIXES, internal_auth_middleware)
  • docker-compose.yml — RAG service port binding

Steps to reproduce

N/A

Expected behavior

N/A

Actual behavior

N/A

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendExpress or API gateway workbugSomething isn't workingdocsDocumentation onlydocumentationImprovements or additions to documentationfeatureA new feature or improvementfixA targeted fix or cleanupfrontendFrontend-related workrag-serviceFastAPI / model service worktype:docstype:security

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions