googleapis / googleapis/google-cloud-python
google-auth: gracefully handle leading whitespace in identity pool PEM parsing
- Langage dominant
- Python
- Étoiles
- 5.4k
- Forks
- 1.8k
- Merge moyen
- 3 j 4 h
- PR mergées (30 j)
- 122
Description
### Summary of the issue
`_read_trust_chain` currently splits the PEM file on the literal `-----BEGIN CERTIFICATE-----` string.
If a perfectly valid PEM file happens to have some comments or blank lines at the top, that garbage ends up in the first split element. This causes `cryptography` to throw a `ValueError` and crash when it tries to load the chain.
### Proposed fix
Instead of a brittle string split, we should use `cryptography`'s native multi-PEM parser so it handles the noise gracefully.
### Affected Files
* `google/auth/identity_pool.py`
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start in google/auth/identity_pool.py at _read_trust_chain and inspect how the PEM content is split before cryptography loads the certificates. Done means valid PEM files with leading comments or blank lines are parsed without a ValueError or crash, while the existing certificate chain behavior remains intact.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- authentication
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- Calme
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 78/100