test(e2e): cover an anonymous read of a publicRead bucket

Aberta
#5,335 0 comentários 1 reação 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
go, helm, kubernetes
Domínio
cloud, testing

Direção de pesquisa

Start with hack/e2e-chainsaw/bucket/chainsaw-test.yaml and read the existing bucket setup and mc checks; hack/select-e2e.sh shows how the suite is selected. Add a Chainsaw case that enables publicRead, waits for the named BucketAccess, checks the unsigned GET, list, and PUT responses, then disables publicRead and checks GET again. Done when the suite verifies the requested status codes in both states.

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

Descrição

triage/needs-triage

No E2E test reads a bucket without credentials, so a broken publicRead would pass CI. #5252 added publicRead to the bucket app and moved the COSI driver to v0.5.0, which grants Read:<bucket> to the shared anonymous identity. Its tests are helm-unittest suites, and the PR says the end-to-end path through the new driver has not run on a cluster.

The bucket suite (hack/e2e-chainsaw/bucket/chainsaw-test.yaml) does run for SeaweedFS and bucket changes: hack/select-e2e.sh maps seaweedfs-application to it. But it creates the bucket with publicRead off and only checks the admin and viewer users with mc. Nothing sends an unsigned request.

So these breaks stay green in CI: the driver stops granting or revoking the anonymous read, a SeaweedFS bump changes how the gateway treats the anonymous identity, or a hook rewrites that identity. Users would see 403 on a public link, or a bucket that stays readable after publicRead is turned off.

Fix shape: a chainsaw case in the bucket suite that sets publicRead: true, waits for the <bucket>-public-read BucketAccess, and checks that an unsigned GET of an object returns 200 while an unsigned list and PUT return 403. Then it sets publicRead: false and checks that the unsigned GET returns 403.

Linguagem predominante
Go
Estrelas
2.2k
Forks
209
Merge médio
4d 14h
PRs com merge (30d)
140

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 cozystack/cozystack

Todas as issues de cozystack/cozystack

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

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