Why this matters
Consent is a lawful basis under LGPD for sensitive data; traceability reduces unlawful processing risk.
Before handling sensitive personal data (e.g., health, biometric), verify a valid consent record and attach its ID to the processing context. Provide a path to revoke consent and stop further processing.
Consent is a lawful basis under LGPD for sensitive data; traceability reduces unlawful processing risk.
Side-by-side examples engineers can pattern-match during review.
app.post('/health-metrics', (req,res)=>{ save(req.body); res.sendStatus(204); })app.post('/health-metrics', requireConsent(['health']), (req,res)=>{ save(req.body, { consentId: req.consentId }); res.sendStatus(204); })\nfunction requireConsent(scopes){ return (req,res,next)=>{ const id=req.header('x-consent-id'); if(!id||!ConsentStore.valid(id,scopes)) return res.status(403).end(); req.consentId=id; next(); } }fetch('/health-metrics',{ headers:{'x-consent-id': cid }})fetch('/health-metrics') // missing consentFrom the same buckets as this rule.