aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- Vorherrschende Sprache
- Python
- Sterne
- 146
- Forks
- 32
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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]
Beitragsleitfaden
Rechercherichtung
Beginne in src/aws_secretsmanager_caching/cache/items.py bei SecretCacheObject.__refresh und lies anschließend nach, wie SecretCacheHook im get-Pfad cached_obj erhält. Bestätige das aktuelle Wrapping-Verhalten für ResourceNotFoundException und definiere als abgeschlossen, dass diese Exception erhalten bleibt, damit Konfigurationsfehler unterschieden werden können und der Hook nicht mit None aufgerufen wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, python
- Bereich
- backend, cloud, security
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100