Derive consent mode from geolocation, not banner config
The consent mode is now determined dynamically by the visitor's country and its applicable regulation. The configured consent_mode column is dropped from cookie_banners and added to cookie_consent_records to persist the geo-derived mode at consent-recording time. When no regulation matches, the default is OPT_OUT. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -4720,7 +4720,6 @@ func (r *Resolver) AddCookieBannerTool(ctx context.Context, req *mcp.CallToolReq
|
||||
PrivacyPolicyURL: input.PrivacyPolicyURL,
|
||||
CookiePolicyURL: input.CookiePolicyURL,
|
||||
ConsentExpiryDays: input.ConsentExpiryDays,
|
||||
ConsentMode: coredata.CookieConsentMode(input.ConsentMode),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, types.AddCookieBannerOutput{}, fmt.Errorf("cannot create cookie banner: %w", err)
|
||||
@@ -4745,10 +4744,6 @@ func (r *Resolver) UpdateCookieBannerTool(ctx context.Context, req *mcp.CallTool
|
||||
if v := UnwrapOmittable(input.ConsentExpiryDays); v != nil && *v != nil {
|
||||
updateReq.ConsentExpiryDays = *v
|
||||
}
|
||||
if v := UnwrapOmittable(input.ConsentMode); v != nil && *v != nil {
|
||||
mode := coredata.CookieConsentMode(**v)
|
||||
updateReq.ConsentMode = &mode
|
||||
}
|
||||
if v := UnwrapOmittable(input.DefaultLanguage); v != nil && *v != nil {
|
||||
updateReq.DefaultLanguage = *v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user