aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- Langage dominant
- Python
- Étoiles
- 146
- Forks
- 32
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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]
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans src/aws_secretsmanager_caching/cache/items.py, au niveau de SecretCacheObject.__refresh, puis examinez comment SecretCacheHook reçoit cached_obj dans le chemin get. Confirmez le comportement actuel de wrapping pour ResourceNotFoundException et définissez comme condition de réussite que cette exception soit préservée, afin que les erreurs de configuration puissent être distinguées et que le hook ne soit pas appelé avec None.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- aws, python
- Domaine
- backend, cloud, security
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100