Add the setting that requires a server credential, switched off

Aberta
#4,240 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@anth-volk já está trabalhando nisso.

Desde 9/11/2026.

  • #4241 de @anth-volk — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
42/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
gcp, python
Domínio
api, authentication, cloud

Direção de pesquisa

Start with the Public API's request-handling entry point and find where a check could run before route matching, so that / and unknown paths are covered too. Then locate the deploy scripts and workflows that set configuration for staging and production, and trace how a new setting would reach them. Done means the setting exists and defaults to off, refused requests get the exact 401 body and headers, GET/HEAD /health, GET /v2/openapi.json and OPTIONS preflight stay open, and the setting is off in both environments. This depends on #4236 landing first.

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

Descrição

Once every PolicyEngine caller sends a server credential (#4236), the Public API needs a setting that refuses everyone else. This issue adds it, switched off; turning it on is a later, separate step.

Done when the Public API has a setting that, when on:

  • refuses every request without a valid server credential with 401, WWW-Authenticate: Bearer, Content-Type: application/json and {"status":"error","message":"Authentication is required"}, with no other guidance;
  • does so before route matching, so / and unknown paths are refused too;
  • exempts only GET and HEAD /health, GET /v2/openapi.json and CORS preflight OPTIONS requests, in the Public API's own code, because Cloud Run's startup probe calls /health on the container directly;

and the setting is wired through the deploy scripts and workflows, merged switched off and deployed switched off in staging and production.

Linguagem predominante
Python
Estrelas
18
Forks
33
Merge médio
2d 14h
PRs com merge (30d)
116

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 PolicyEngine/policyengine-api

Todas as issues de PolicyEngine/policyengine-api

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

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