The five-minute audit
Challenge on lesson: Checkpoint: Security Engineering
Implement security_gate(handlers) โ stricter cousin of the practice audit:
- each handler: {'name', 'checks': set, 'public': bool} where 'public' marks endpoints intentionally unauthenticated (health checks)
- an endpoint that is NOT public must have 'auth' AND 'owner' (data endpoints) โ missing either โ vulnerable with 'critical': True
- an endpoint that IS public but has any of 'auth'/'owner' checks is suspicious (flag 'suspicious': True โ why would a health check need auth code?)
- missing 'params' or 'encode' โ vulnerable (not critical)
- return {'clean': [...], 'vulnerable': [...worst-first, ties by name...]} where vulnerable entries carry 'missing' (sorted), and 'critical'/'suspicious' booleans only when True
Back to lesson: Checkpoint: Security Engineering