Commit d2fb97e
authored
Fix/workaround secret leak2 (#898)
* Delete all secrets with the matching name/id.
This introduces two changes:
(1) If there are many matches, we delete all matching secrets.
Due to a previous issue, we may have many ...
(2) We extract the UUID from the id string and pass it to
delete_secret(). This is a workaround to something that looks
like a bug in the SDK to me.
* Comment on the workaround. Robust against fixed SDK ...
Let's comment on the SDK issue here.
If it should change to return a UUID in the id attribute, we would now
still work, so we are robust against a possible direction that a fix
might take.
* Appease flake8.
* Cosmetic: Use plural in fn name. More SDK explanation.
Improve comment explaining the SDK (and possibly API) misbehavior.
Also add comment on chosen workaround with robustness in mind,
but without taking it to the extreme of adding 5 additional API calls.
* Add wrapper _delete_secret() that accepts a Secret object.
This keeps the code cleaner.
* More elegant UUID extraction avoiding case distinction.
... based on suggestion by @mbuechse.
Signed-off-by: Kurt Garloff <[email protected]>1 parent 8ebb19d commit d2fb97e
1 file changed
+34
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
71 | 93 | | |
72 | 94 | | |
73 | 95 | | |
| |||
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
84 | 109 | | |
85 | 110 | | |
86 | 111 | | |
| |||
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
92 | | - | |
| 117 | + | |
93 | 118 | | |
94 | 119 | | |
95 | 120 | | |
96 | | - | |
| 121 | + | |
97 | 122 | | |
98 | 123 | | |
99 | 124 | | |
| |||
0 commit comments