From 24e7387f3d2bfacc7689d8f549eb671652bc7bb4 Mon Sep 17 00:00:00 2001 From: Charles Bissonnette Date: Wed, 15 Apr 2026 11:27:27 -0700 Subject: [PATCH 1/2] Add 'Your Privacy Choices' link to footer Add a configurable 'Your Privacy Choices' link with opt-out SVG icon between 'Terms of Use' and 'Privacy Statement' in the site footer. - Add ExternalYourPrivacyChoicesUrl to IAppConfiguration/AppConfiguration - Add YourPrivacyChoices() URL helper extension method - Insert link with icon in both footer code paths (external branding and .NET Foundation) - Default URL: https://aka.ms/yourcaliforniaprivacychoices Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Configuration/GalleryConfiguration.cs | 1 + .../Configuration/AppConfiguration.cs | 5 +++++ .../Configuration/IAppConfiguration.cs | 5 +++++ src/NuGetGallery/UrlHelperExtensions.cs | 10 ++++++++++ .../Views/Shared/Gallery/Footer.cshtml | 20 ++++++++++++++++++- src/NuGetGallery/Web.config | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/AccountDeleter/Configuration/GalleryConfiguration.cs b/src/AccountDeleter/Configuration/GalleryConfiguration.cs index 6eda0ca953..9a0b06117a 100644 --- a/src/AccountDeleter/Configuration/GalleryConfiguration.cs +++ b/src/AccountDeleter/Configuration/GalleryConfiguration.cs @@ -120,5 +120,6 @@ public string SiteRoot public int MaxJsonLengthOverride { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public int MaxOwnerPerPackageRegistration { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public int MaxOwnerRequestsPerPackageRegistration { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public string ExternalYourPrivacyChoicesUrl { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } } } diff --git a/src/NuGetGallery.Services/Configuration/AppConfiguration.cs b/src/NuGetGallery.Services/Configuration/AppConfiguration.cs index 98d67d4299..359d21a9e7 100644 --- a/src/NuGetGallery.Services/Configuration/AppConfiguration.cs +++ b/src/NuGetGallery.Services/Configuration/AppConfiguration.cs @@ -323,6 +323,11 @@ public class AppConfiguration : IAppConfiguration /// public string ExternalPrivacyPolicyUrl { get; set; } + /// + /// Gets/sets a string that is a link to an external "Your Privacy Choices" page + /// + public string ExternalYourPrivacyChoicesUrl { get; set; } + /// /// Gets/sets a string that is a link to an external terms of use document /// diff --git a/src/NuGetGallery.Services/Configuration/IAppConfiguration.cs b/src/NuGetGallery.Services/Configuration/IAppConfiguration.cs index 32a75c290e..11ee16b761 100644 --- a/src/NuGetGallery.Services/Configuration/IAppConfiguration.cs +++ b/src/NuGetGallery.Services/Configuration/IAppConfiguration.cs @@ -349,6 +349,11 @@ public interface IAppConfiguration : IMessageServiceConfiguration /// string ExternalPrivacyPolicyUrl { get; set; } + /// + /// Gets/sets a string that is a link to an external privacy choices page + /// + string ExternalYourPrivacyChoicesUrl { get; set; } + /// /// Gets/sets a string that is a link to an external terms of use document /// diff --git a/src/NuGetGallery/UrlHelperExtensions.cs b/src/NuGetGallery/UrlHelperExtensions.cs index 6b4c653867..8ac746b323 100644 --- a/src/NuGetGallery/UrlHelperExtensions.cs +++ b/src/NuGetGallery/UrlHelperExtensions.cs @@ -1471,6 +1471,16 @@ public static string Privacy(this UrlHelper url, bool relativeUrl = true) return GetActionLink(url, "Privacy", "Pages", relativeUrl); } + public static string YourPrivacyChoices(this UrlHelper url, bool relativeUrl = true) + { + if (!String.IsNullOrEmpty(_configuration.Current.ExternalYourPrivacyChoicesUrl)) + { + return _configuration.Current.ExternalYourPrivacyChoicesUrl; + } + + return GetActionLink(url, "Your Privacy Choices", "Pages", relativeUrl); + } + public static string ExternalPrivacyUrl(this UrlHelper url) { return _configuration.Current.ExternalPrivacyPolicyUrl; diff --git a/src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml b/src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml index 55b67ab238..c462d7c836 100644 --- a/src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml +++ b/src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml @@ -34,7 +34,8 @@ !String.IsNullOrEmpty(this.Config.Current.ExternalBrandingUrl) || !String.IsNullOrEmpty(this.Config.Current.ExternalAboutUrl) || !String.IsNullOrEmpty(this.Config.Current.ExternalTermsOfUseUrl) || - !String.IsNullOrEmpty(this.Config.Current.ExternalPrivacyPolicyUrl)) + !String.IsNullOrEmpty(this.Config.Current.ExternalPrivacyPolicyUrl) || + !String.IsNullOrEmpty(this.Config.Current.ExternalYourPrivacyChoicesUrl)) {