Accept a user identity forwarded by a credentialed server

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

  • #4239 de @anth-volk — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
32/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python

Direção de pesquisa

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.

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

Descrição

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.
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.