Add the setting that requires a server credential, switched off

Ouverte
#4,240 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
42/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
gcp, python

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
18
Forks
33
Merge moyen
2 j 14 h
PR mergées (30 j)
116

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PolicyEngine/policyengine-api

Toutes les issues de PolicyEngine/policyengine-api

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.