aws / aws/aws-secretsmanager-caching-python

Don't wrap ResourceNotFoundException

オープン
#20 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
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 から始め、次に get パスで SecretCacheHook が cached_obj を受け取る仕組みを確認します。ResourceNotFoundException の現在の wrapping 動作を確認し、設定エラーを区別でき、hook が None で呼び出されないように、その例外を保持することを完了条件とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, python
領域
backend, cloud, security
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。