fix(api): rimuovi POST /api/monitor e il validatore Clerk residuo - #99
Open
Larslllllll wants to merge 1 commit into
Open
Conversation
L'endpoint era dichiarato protetto da Clerk JWT ma il validatore
restituiva {} quando CLERK__ENABLED=false (il default), lasciandolo
completamente aperto: chiunque poteva far partire sweep MAF a ripetizione
e consumare budget LLM.
Cambiamenti:
- ELIMINATO src/limen/api/endpoints/monitor.py
- ELIMINATO src/limen/api/auth.py (vecchio validatore JWT Clerk)
- Rimosso monitor dal router in endpoints/__init__.py
- Rimosso MonitorRequest e MonitorResponse da schemas.py
- Rimosso ClerkSettings da config/settings.py
- Rimosso blocco CLERK__ da .env.example
- Rimosso pyjwt[crypto] da pyproject.toml
- ELIMINATO tests/unit/test_clerk_auth.py
- Rimossi 4 test di integrazione che dipendevano da /api/monitor
- Aggiornato README.md, CLAUDE.md, docs/api.md
Closes agent-engineering-studio#70
Part of agent-engineering-studio#69
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.
Problema
POST /api/monitor/{aoi_id}è dichiarato "protetto" ma la protezione è codice morto:src/limen/api/auth.pyè il vecchio validatore JWT di Clerk che non è più in uso.require_userrestituisce{}quandosettings.clerk.enabledèFalse, che è il default.CLERK__ENABLED=true: può far partire sweep MAF a ripetizione consumando budget LLM.Soluzione
Rimuovere l'endpoint HTTP e il validatore residuo. Il lancio manuale di uno sweep ha già due superfici adeguate a chi gestisce il sistema:
uv run limen monitor-oncerun_monitorinsrc/limen/mcp/tools.py(fail-closed suMCP_ADMIN_TOKEN)Cambiamenti
src/limen/api/endpoints/monitor.pysrc/limen/api/auth.pyendpoints/__init__.pyMonitorRequest/MonitorResponsedaschemas.pyClerkSettingsdaconfig/settings.pyCLERK__da.env.examplepyjwt[crypto]dapyproject.tomltests/unit/test_clerk_auth.py/api/monitorVerifica
```bash
grep -rn "api/monitor|MonitorRequest|MonitorResponse|clerk|Clerk|import jwt|from jwt" src tests
atteso: nessun risultato
```
Closes #70
Part of #69