feat(core-consent): add extractAnonymousConsent and migrateAnonymousConsent helpers

Migration helpers let the auth signUp flow transfer anonymous cookie consent
to an authenticated user's record. extractAnonymousConsent parses the raw
Cookie header; migrateAnonymousConsent calls IConsent.grant with
method: "signup-migration" for each granted category, making the migration
traceable in the audit log. No-op when the consent cookie is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 12:59:53 +00:00
parent c346f85bc8
commit b24f0666eb
4 changed files with 194 additions and 22 deletions

View File

@@ -16,3 +16,8 @@ export {
type ConsentFactory,
} from "./di/bind-production";
export { bindDevSeedConsent } from "./di/bind-dev-seed";
export {
CONSENT_COOKIE_NAME,
extractAnonymousConsent,
migrateAnonymousConsent,
} from "./migration";