aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- Ngôn ngữ chính
- Python
- Star
- 146
- Fork
- 32
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
If the secret is not on AWS Secrets Manager the client will throw a `ResourceNotFoundException` that will be wrapped in [`SecretCacheObject.__refresh`](https://github.com/aws/aws-secretsmanager-caching-python/blob/8b3ed311982096d6cb6a99ab33299ade3c9811b3/src/aws_secretsmanager_caching/cache/items.py#L97)
I think to **wrap `ResourceNotFoundException` is not good practice**: because after the client application has no way to understand that something is wrong in the configuration of Aws SM, and if you have a hook it will be triggered anyway even if an exception occurred and the value is None.
[the implementation of `SecretCacheHook` will receive `cached_obj = None` in the get method]
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu tại src/aws_secretsmanager_caching/cache/items.py, ở SecretCacheObject.__refresh, sau đó đọc cách SecretCacheHook nhận cached_obj trong đường đi get. Xác nhận hành vi wrapping hiện tại đối với ResourceNotFoundException và xác định hoàn thành khi exception đó được giữ nguyên, ताकि các lỗi cấu hình có thể được phân biệt và hook không được gọi với None.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, python
- Lĩnh vực
- backend, cloud, security
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- 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
- 38/100