Commit 8149682
committed
feat: add logging for verification errors, disabled state, and replay attacks
- Add a module-level logger using logging.getLogger(__name__)
- Log a warning when ALTCHA_VERIFICATION_ENABLED is False, making it
clear that the CAPTCHA provides no protection in that state
- Log a warning with the exception message when verification raises an
unexpected error, aiding debugging without leaking details to the user
- Log a warning when verification returns a failed result, including the
error detail from the altcha library
- Log a warning with the challenge hash when a replay attack is detected
- Log a warning with the exception message when payload decoding fails
Signed-off-by: Hervé Le Roy <hleroy@hleroy.com>1 parent 9d0895f commit 8149682
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
231 | 240 | | |
232 | 241 | | |
233 | 242 | | |
| |||
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
246 | | - | |
| 255 | + | |
| 256 | + | |
247 | 257 | | |
248 | 258 | | |
249 | 259 | | |
| 260 | + | |
250 | 261 | | |
251 | 262 | | |
252 | 263 | | |
| |||
257 | 268 | | |
258 | 269 | | |
259 | 270 | | |
260 | | - | |
| 271 | + | |
| 272 | + | |
261 | 273 | | |
262 | 274 | | |
263 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
264 | 279 | | |
265 | 280 | | |
266 | 281 | | |
| |||
0 commit comments