Commit ecd6d01
authored
notify-mailer: Improve error checking during template execution (letsencrypt#5932)
- Break message body construction out into a testable method.
- Ensure that in the event of a missing key, an informative error is returned instead
of allowing the message to be populated with the zero value of the key.
- Add message body construction tests for success, empty map, and missing key.
- Comment the `recipient` struct and it's `Data` field to make it clear that SRE
must be informed of any modifications.
Fixes letsencrypt#59211 parent f69f524 commit ecd6d01
2 files changed
+82
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
105 | 124 | | |
106 | 125 | | |
107 | 126 | | |
| |||
161 | 180 | | |
162 | 181 | | |
163 | 182 | | |
164 | | - | |
165 | | - | |
| 183 | + | |
166 | 184 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 185 | + | |
| 186 | + | |
172 | 187 | | |
173 | 188 | | |
174 | | - | |
| 189 | + | |
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
| |||
253 | 268 | | |
254 | 269 | | |
255 | 270 | | |
256 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
257 | 277 | | |
| 278 | + | |
258 | 279 | | |
259 | 280 | | |
260 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
261 | 285 | | |
262 | 286 | | |
263 | 287 | | |
| |||
384 | 408 | | |
385 | 409 | | |
386 | 410 | | |
387 | | - | |
| 411 | + | |
388 | 412 | | |
389 | 413 | | |
390 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
228 | 275 | | |
229 | 276 | | |
230 | 277 | | |
| |||
0 commit comments