Make cookie banner origin immutable after creation
Origin is a fundamental identity property of a banner tied to consent records for a specific site. Changing it would break the audit trail and violate GDPR consent specificity requirements. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -61,7 +61,6 @@ type (
|
||||
UpdateCookieBannerRequest struct {
|
||||
CookieBannerID gid.GID
|
||||
Name *string
|
||||
Origin *string
|
||||
PrivacyPolicyURL *string
|
||||
ConsentExpiryDays *int
|
||||
ConsentMode *coredata.CookieConsentMode
|
||||
@@ -175,7 +174,6 @@ func (r *UpdateCookieBannerRequest) Validate() error {
|
||||
|
||||
v.Check(r.CookieBannerID, "cookie_banner_id", validator.Required(), validator.GID(coredata.CookieBannerEntityType))
|
||||
v.Check(r.Name, "name", validator.SafeTextNoNewLine(255))
|
||||
v.Check(r.Origin, "origin", validator.Origin())
|
||||
v.Check(r.PrivacyPolicyURL, "privacy_policy_url", validator.URL())
|
||||
v.Check(r.ConsentExpiryDays, "consent_expiry_days", validator.Min(1))
|
||||
v.Check(r.ConsentMode, "consent_mode", validator.OneOfSlice(coredata.CookieConsentModes()))
|
||||
@@ -775,9 +773,6 @@ func (s *Service) UpdateCookieBanner(
|
||||
if req.Name != nil {
|
||||
banner.Name = *req.Name
|
||||
}
|
||||
if req.Origin != nil {
|
||||
banner.Origin = CanonicalizeOrigin(*req.Origin)
|
||||
}
|
||||
if req.PrivacyPolicyURL != nil {
|
||||
banner.PrivacyPolicyURL = *req.PrivacyPolicyURL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user