Skip to content

Add auth middleware to Ollama /tags endpoint - #2

Open
heliosran wants to merge 1 commit into
mainfrom
codex/add-openaiauthmiddleware-to-/tags-route
Open

Add auth middleware to Ollama /tags endpoint#2
heliosran wants to merge 1 commit into
mainfrom
codex/add-openaiauthmiddleware-to-/tags-route

Conversation

@heliosran

Copy link
Copy Markdown
Owner

Motivation

  • Ensure the Ollama GET /api/tags endpoint is protected by the same OpenAI API key authentication as the other Ollama routes to avoid an unintentionally public /api/* route.

Description

  • Add openaiAuthMiddleware() to the ollama.get("/tags", ...) declaration in src/routes/ollama.ts, changing it to ollama.get("/tags", openaiAuthMiddleware(), async (c) => { ... }).

Testing

  • Ran rg 'ollama\.(get|post)\(' -n src/routes/ollama.ts && rg 'openai\.(get|post)\(' -n src/routes/openai.ts and inspected docs/authentication.md to verify all exposed /api routes now include the auth middleware; the checks succeeded.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant