Add the setting that requires a server credential, switched off

Offen
#4,240 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@anth-volk arbeitet bereits daran.

Seit 09.11.2026.

  • #4241 von @anth-volk — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
gcp, python

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
18
Forks
33
Ø Merge
2 T. 14 Std.
Gemergte PRs (30 T.)
116

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PolicyEngine/policyengine-api

Alle Issues in PolicyEngine/policyengine-api

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.