Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Reject a news link that points back at the participant portal

Aberta Para iniciantes
#987 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
63/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
api, backend

Direção de pesquisa

Leia SettingsController.ts:37-44 e SettingsController.ts:86-101 para acompanhar a validação de newsLink e, em seguida, confira SettingsController.test.ts para ver os testes de validação de URL existentes. Adicione cobertura para um newsLink cuja origem corresponda a HOSTNAME e verifique se a solicitação retorna 422. O issue diz que isso depende de #937 e pode ser combinado com #973, então confira o status deles antes de começar.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
4
Forks
0
Merge médio
8h 37min
PRs com merge (30d)
3

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Garvan-Data-Science-Platform/ctrl

Todas as issues de Garvan-Data-Science-Platform/ctrl

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.