Accept a user identity forwarded by a credentialed server

Offen
#4,238 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.

  • #4239 von @anth-volk — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
32/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python

Rechercherichtung

Start with the signed-in user routes named in the issue (/v2/me*, /v2/user-*, and POST /v2/me/upgrade) and find where the request's Authorization header is read to identify the user. The change adds a second header path that is honored only when the request carries a server credential, and the issue's three 'done' bullets are the test cases to write. Done means a forwarded user token or the unauthenticated-user header resolves to the same user as a direct request, and a bare user token in Authorization still works.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

PolicyEngine's web servers will call the Public API with their own server credential in Authorization (#4236). When such a server acts for a person, the signed-in user routes (/v2/me*, /v2/user-*) need to know who that person is, but Authorization is already taken by the server's token.

Done when:

  • a credentialed server can forward a signed-in user's Auth0 token in PolicyEngine-User-Authorization: Bearer <token>, or a signed-out browser's PolicyEngine-Unauthenticated-User header;
  • the user routes treat that user exactly as they treat a direct request with the same credential today, including POST /v2/me/upgrade;
  • until enforcement, a user's token sent directly in Authorization keeps working, and PolicyEngine-User-Authorization is ignored on any request without a server credential.
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.