firebase / firebase/firebase-admin-node
[FR]: add function to set single claim instead of all claims `setCustomUserClaim('myClaim', value)`
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 16
Mô tả
**Is your feature request related to a problem? Please describe.**
When updating auth custom claims, i need to make sure i always include all existing claims, because `setCustomUserClaims` always overrides all claims. --> When multiple requests run simultaneously, we run into transactional issues (2 requests read claims, first requests updates claims with a new field, second request updates claims with another field but overrides changes from first request).
**Describe the solution you'd like**
`setCustomUserClaim('myClaim', value)` in addition to `setCustomUserClaims(allClaims)`
**Describe alternatives you've considered**
Writing claims to my own db, then regularly sync it to firebase -> this is too complicated though for something that could be solved much simpler with a new method `setCustomUserClaim`.
**Additional context**
none
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc API setCustomUserClaims hiện có và cách xử lý custom claims trong Authentication SDK. Xác định ngữ nghĩa về tính đồng thời và việc thay thế cho một phương thức setCustomUserClaim, sau đó bổ sung phạm vi kiểm thử cho việc cập nhật một claim mà không ghi đè các claim khác; được xem là hoàn thành khi API và hành vi của nó đã được lập tài liệu và kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- nodejs, typescript
- Lĩnh vực
- authentication, backend-api-design
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100