googleapis / googleapis/google-cloud-python
google-auth: gracefully handle leading whitespace in identity pool PEM parsing
- Ngôn ngữ chính
- Python
- Star
- 5.4k
- Fork
- 1.8k
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 122
Mô tả
### 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`
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- authentication
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 78/100