Repository navigation
Conversation
Two related fixes: - WIKI_AUTH_MODE previously only protected DELETE /api/wiki_cache; every other sensitive/costly route (wiki generation, repo indexing, chat, codemap, cache reads) performed no authorization check at all, so an operator who enabled the one documented protection mechanism got no actual protection anywhere but that single endpoint. Adds a shared check_wiki_auth_code() dependency (api/routers/auth.py) and an authorization_code field on RepoRequestBase, applied to every route that generates, indexes, chats, or reads cached wiki content. - Wiki task submission (POST /wiki/tasks) and repo indexing (POST /repo/prepare) each admitted a new asyncio task into their respective tracking state unconditionally, before any concurrency limit applied. A caller varying repo_url could queue an unbounded number of pending clone/embedding jobs. Adds an admission cap on distinct non-terminal tasks (TaskRegistry.max_pending, default 10x the execution semaphore) and a parallel cap on /repo/prepare's own in-flight job set, both returning 429 once full. Adds regression tests in tests/backend/routers/test_wiki_auth_enforcement.py (new) and tests/backend/services/test_wiki_task.py, including fail-before coverage run against the unpatched code.
This was referenced Oct 5, 2026
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related fixes:
WIKI_AUTH_MODEpreviously only protectedDELETE /api/wiki_cache; every other sensitive/costly route (wiki generation, repo indexing, chat, codemap, cache reads) performed no authorization check at all, so an operator who enabled the one documented protection mechanism got no actual protection anywhere but that single endpoint. Adds a sharedcheck_wiki_auth_code()dependency (api/routers/auth.py) and anauthorization_codefield onRepoRequestBase, applied to every route that generates, indexes, chats, or reads cached wiki content.POST /wiki/tasks) and repo indexing (POST /repo/prepare) each admitted a new asyncio task into their respective tracking state unconditionally, before any concurrency limit applied. A caller varyingrepo_urlcould queue an unbounded number of pending clone/embedding jobs. Adds an admission cap on distinct non-terminal tasks (TaskRegistry.max_pending, default 10x the execution semaphore) and a parallel cap on/repo/prepare's own in-flight job set, both returning 429 once full.Test plan
pytest tests/backend/routers/test_wiki_auth_enforcement.py tests/backend/services/test_wiki_task.py: new regression tests pass.pytest tests/: full suite passes with no regressions.TaskQueueFullErrordidn't exist).