googleapis / googleapis/google-cloud-python

google-auth: gracefully handle leading whitespace in identity pool PEM parsing

Abierto Apto para principiantes
#17,623 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

### 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`

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
authentication
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
78/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.