Commit 5f4ecc0
authored
Improve log when secret is not found in keyVault (#173)
This pull request introduces improvements to error handling and logging
when interacting with Azure Key Vault. The changes primarily focus on
providing more detailed error messages by including the path of the
secret that caused the error.
### Improvements to error handling:
*
[`src/Confix.Tool/src/Confix.Library/ThrowHelper.cs`](diffhunk://#diff-de2d44cf88807e7118a43465a75745e67e659f7268cad9c28496735aac87ad67L44-R48):
Modified the `SecretNotFound` method to accept an optional `path`
parameter and include it in the error message if provided.
### Updates to method signatures:
*
[`src/Confix.Tool/src/Confix.Library/Utilities/Azure/KeyVaultExtension.cs`](diffhunk://#diff-520f5459080dfd82d45c6e5bf94a9cc9a0ecda7e85b403aa953d50421aee0ebcL4-R17):
Updated the `HandleKeyVaultException` method to accept an optional
`path` parameter and pass it to the `SecretNotFound` method.
### Enhancements to Azure Key Vault provider:
*
[`src/Confix.Tool/src/Confix.Library/Variables/Providers/AzureKeyVault/AzureKeyVaultProvider.cs`](diffhunk://#diff-bcce2fb5047575d77b3d9a54ee0f9df0688c86e01fb6afd1665a8ae18b20f135L57-R57):
Updated the `ResolveAsync` and `SetAsync` methods to pass the `path`
parameter to the `HandleKeyVaultException` method.
[[1]](diffhunk://#diff-bcce2fb5047575d77b3d9a54ee0f9df0688c86e01fb6afd1665a8ae18b20f135L57-R57)
[[2]](diffhunk://#diff-bcce2fb5047575d77b3d9a54ee0f9df0688c86e01fb6afd1665a8ae18b20f135L75-R75)-
mention secret path in error message when available1 parent da7cdbe commit 5f4ecc0
3 files changed
Lines changed: 15 additions & 13 deletions
File tree
- src/Confix.Tool/src/Confix.Library
- Utilities/Azure
- Variables/Providers/AzureKeyVault
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | | - | |
| 72 | + | |
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
0 commit comments