Reject a news link that points back at the participant portal
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 63/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Leggi SettingsController.ts:37-44 e SettingsController.ts:86-101 per seguire la convalida di newsLink, poi controlla SettingsController.test.ts per individuare i test di convalida URL esistenti. Aggiungi test per un newsLink la cui origine corrisponde a HOSTNAME e verifica che la richiesta restituisca 422. L’issue dice che questo dipende da #937 e può essere combinato con #973, quindi controllane lo stato prima di iniziare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
PATCH /settings accepts a newsLink on the participant portal's own host, and the admin gets no sign anything is wrong. updateSettings in SettingsController.ts:86-101 only runs sanitiseAndValidateUrl (SettingsController.ts:37-44), which checks the URL's shape, not where it points.
Before #986, a link like that made the portal load itself inside the news page (#861). Since #986, the participant portal treats it as no link (isUsableNewsLink in application/user-client/src/App.tsx), so News quietly drops out of the menu. The admin sees a successful save and has no way to tell why News is gone.
The backend already knows the portal's address. HOSTNAME is the participant portal URL used to build the register and reset-password links (ParticipantsController.ts:1006, UsersController.ts:405).
Proposal: reject a newsLink whose origin matches HOSTNAME's with a 422, the same way the existing URL check fails, and add a test in SettingsController.test.ts.
#937 and #973 both change sanitiseAndValidateUrl, so this is easiest once #937 lands, and could go in with #973.
Related: #861, #986, #598, #956.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 0
- Merge medio
- 8h 37m
- PR unite (30g)
- 3
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Garvan-Data-Science-Platform/ctrl
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
admin-client backend bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
backend bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 commento ·
-
backend bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
backend bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Tutte le issue di Garvan-Data-Science-Platform/ctrl
Issue simili
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Apertaarea: backend documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
snapotter-hq/SnapOtter#2919 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
obsidianmd/pele#39 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
biomejs/biome#12475 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno