googleapis / googleapis/google-cloud-python

Stripping "Z" from expiry date parsing in Credentials may lead to incorrect expires_at timestamp

Đang mở
#15,192 16 bình luận 0 reaction 0 người được giao Xem trên GitHub
priority: p2 type: cleanup type: feature request
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ả

#### Environment details

- OS: Mac OS 13.2.1
- Python version: 3.10.8
- pip version: 22.2.2
- `google-auth` version: 2.17.0

#### Steps to reproduce

1. Retrieve an initial access token via InstalledAppFlow with no TZ set and system time zone set to UTC-X (e.g. EDT)
2. Observe that expire_at is set beyond 1 hour (it should be returned with 1 hour + abs(time zone difference to UTC))
3. Refresh will not occur as expected and the access token expires

#### Notes

I believe the culprit may be [here](https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/credentials.py#L398). The symptom investigations are [here](https://github.com/gilesknap/gphotos-sync/issues/413#issuecomment-1489341338).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.