Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Reject a news link that points back at the participant portal

Aperta Adatta ai principianti
#987 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Ambito
api, backend

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

backend enhancement

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Garvan-Data-Science-Platform/ctrl

Tutte le issue di Garvan-Data-Science-Platform/ctrl

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.