googleapis / googleapis/google-cloud-python
google-auth: gracefully handle leading whitespace in identity pool PEM parsing
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1.8k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 122
描述
### 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`
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- authentication
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 78/100