aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- 主要语言
- Python
- 星标
- 146
- 派生
- 32
- PR 合并指标
- 30 天内没有已合并 PR
描述
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]
贡献指南
调研方向
从 src/aws_secretsmanager_caching/cache/items.py 中的 SecretCacheObject.__refresh 开始,然后阅读 SecretCacheHook 如何在 get 路径中接收 cached_obj。确认当前对 ResourceNotFoundException 的 wrapping 行为,并将保留该异常定义为完成标准,以便区分配置错误,并且不会使用 None 调用 hook。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- aws, python
- 领域
- backend, cloud, security
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100