aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- Lingua principale
- Python
- Stelle
- 146
- Fork
- 32
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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]
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in src/aws_secretsmanager_caching/cache/items.py, in SecretCacheObject.__refresh, quindi leggi come SecretCacheHook riceve cached_obj nel percorso get. Conferma il comportamento attuale di wrapping per ResourceNotFoundException e considera completato il lavoro quando quell'eccezione viene preservata, in modo che gli errori di configurazione siano distinguibili e l'hook non venga invocato con None.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, python
- Ambito
- backend, cloud, security
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100