-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.
Description
| return "".join(random.choice(_AUTO_ID_CHARS) for _ in range(20)) |
The above line is crpytographically insecure. If the python interpreter calls random.seed(0), then the same sequence of document ids will be generated. This leads to database collisions which is undesirable.
Environment details
- OS type and version: MacOS Tahoe 26.2
- Python version: Python 3.10.1
- pip version: pip 21.2.4
google-cloud-firestoreversion: 2.20.0
Steps to reproduce
import random
random.seed(0)
from google.cloud.firestore_v1.base_collection import _auto_id
print(_auto_id())prints
2Yw4aCQ9gfZ6y1T9eWl5
every time.
Code example
See above
Stack trace
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.