Skip to content

#13038 Add shared privacy settings and consent management to Vanilla - #13039

Open
simboss wants to merge 7 commits into
masterfrom
codex/vanilla-privacy-consent
Open

simboss wants to merge 7 commits into
masterfrom
codex/vanilla-privacy-consent

Conversation

@simboss

@simboss simboss commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

Add a common privacy panel and a consent lifecycle to MapStore. The panel opens on first entry through the home page or a direct resource URL and remains accessible from the footer on maps, Dashboards, GeoStories and embeds.

The default configuration contains no optional categories. It provides information about necessary tools and remembers dismissal separately from consent. Deployments that configure optional tools can offer refusal, acceptance, granular choices and withdrawal; registered integrations stay inactive until their category is allowed.

Please check if the PR fulfills these requirements

  • Commit messages follow the contribution guidelines.
  • Regression tests have been added.
  • User, configuration and migration documentation has been added or updated.

Issue

Closes #13038

What is the current behavior?

The cookie notice stores a blanket acknowledgement rather than category-specific decisions. Its "More details" text is an old HTML fragment that is not presented as a template. The notice does not manage the lifecycle of optional integrations, and access to privacy information is inconsistent across application entry points. Standard sharing mounts Social controls and automatic counters.

What is the new behavior?

  • One privacy panel and persistent footer access across the supported routes. Necessary tools are always active; unused optional categories have no switches. Closing necessary-only information does not express consent or accept service terms.
  • Versioned optional choices with expiry, cross-tab updates, refusal and withdrawal. Registered factories start only after consent and receive an AbortSignal plus a synchronous teardown contract.
  • Selective cleanup of legacy acknowledgements and invalid privacy records. Old approvals never become consent, valid applicable choices are retained, and authentication and unrelated storage are preserved. Storage failures leave optional tools inactive.
  • Policy pages (Cookie Policy, Privacy Policy, Terms of Use). The panel takes the links from the first source that configures a page:
    1. privacy.links in localConfig.json, as a url or a url by locale;
    2. an installed privacy settings extension;
    3. the template pages shipped with MapStore in product/assets/privacy, with the cookie and browser-storage inventory of the default configuration.
  • While the template pages are in use, the panel shows a warning to every user, with a link to the documentation, and the plugin writes a warning in the console. Each template page also says that it is a template. The warning goes away when the installation disables the panel ("enabled": false), installs an extension or configures privacy.links.
  • An installation can configure everything with an extension, without changing localConfig.json: the extension dispatches setControlProperty('privacy', 'defaults', ...) (pages, policy version, retention, categories) and follows the consent through SET_PRIVACY_CHOICE. The template of the extension, with pages by locale, is geosolutions-it/mapstore-privacy-settings-extension.
  • The panel texts are MapStore translations (en, it, de, es, fr; English in the other languages). They can be replaced from the translations folder of an extension, or from the configuration by adding a data directory folder to translationsPath.
  • The old cookie notice (Accept, More details, Leave) is removed, with its externalCookieUrl and declineUrl options and the translations/fragments/cookie pages. With privacy.enabled set to false, or without the privacy section, MapStore shows no notice.
  • Standard sharing retains link copy, QR code, permalink and embeds while removing the Social tab and automatic counters. A saved social tab selection opens the link tab.
  • No external request before the bundle: Google Fonts links are removed and the browser check is an inline script that redirects Internet Explorer, without loading Bowser from unpkg (the previous check also redirected Opera, Samsung Internet, Vivaldi and Yandex). dxf-parser is loaded only when a DXF file is read, and the loglevel value it stores on load is removed.
  • The product WAR and the project template copy the template pages, so their default links work in both.

Breaking change

  • Yes, deployment and custom-client migration notes are included.

The standard Social tab is removed, together with the socialPanel and getCount options of SharePanel. Legacy cookie acknowledgements do not suppress the new privacy information or grant optional consent. Until an installation configures its own policy pages, the panel shows the template warning to every user. Custom applications must include the Cookie plugin on their relevant routes, provide and link their policy pages and register any optional integration. Existing projects must add the copy of the template pages to their web/pom.xml, or configure privacy.links. The old cookie notice is removed with its externalCookieUrl and declineUrl options: with the privacy configuration disabled or missing, no notice is shown. No backend API or database schema changes are introduced.

See Privacy and Consent Configuration and the migration guide in this branch.

Validation

On Linux with Node 20 and Chrome Headless, on the branch rebased on master:

  • Full JavaScript suite: 10,997 passed, 8 skipped.
  • ESLint, Markdown and JSON checks: passed. Translation check: no missing privacySettings message.
  • Production frontend build and WAR build: passed. Java tests were not run (-DskipTests). The WAR contains one spring-web jar and starts without changes.
  • Copy of the template pages in the project template: checked with the execution alone; a full project build was not run.
  • Browser checks on the WAR with an empty data directory:
    • first visit: template links, panel warning with the documentation link, console warning, template pages with their notice and styles;
    • extension built from the public template and from an operator repository, uploaded and removed: extension pages, no warning; after removal the template pages and the warning are back;
    • privacy.links in localConfig.json.patch: operator pages, no warning; privacy.enabled: false: no panel, no footer entry and no old notice;
    • panel texts replaced through translationsPath in localConfig.json.patch; a language without a file keeps the MapStore texts;
    • earlier rounds: pages by locale, policy version, retention, privacy.links precedence, accept, refuse, customize and withdraw with an extension integration started and stopped through SET_PRIVACY_CHOICE.

Deployment notes

This PR targets master; it will be backported to 2026.03.xx. Docker and Helm files are unchanged. Deployment operators must verify actual services, purposes, retention and providers, and publish their policy pages. The widget does not automatically control arbitrary plugins, undo transmitted data or delete third-party cookies.

The local synthetic fixture, test credentials, databases, runtime volumes and local reports are not included in this PR. #12842 is background only and has not been modified.

Review follow-up

Second round:

  • The branch is rebased on master. The Social tab is removed from the list-based tabs of SharePanel now on master; the embed tab moves from position 3 to 2, and the tests follow.
  • The template pages are back in product/assets/privacy, linked only when nothing else configures a page, instead of in localConfig.json: an extension can still replace them. References to the MapStore version and to a commit are removed from the pages.
  • Template warning in the panel and in the console, with a link to the documentation.
  • Documentation of the languages of the pages and of the panel texts, for the configuration and for the extension.
  • Product WAR and project template copy the template pages; migration guide entry for existing projects.
  • The old cookie notice is removed: disabling the privacy configuration showed it again, with an outdated text.

First round:

  • A refusal or withdrawal that cannot be saved keeps optional tools off on the page and the panel open with the error; the periodic recheck no longer restores an older readable consent, which MapStore also tries to remove.
  • The DXF and Bowser changes no longer need a vendored file or a webpack module replacement.
  • The test of the DXF storage now checks the storage after the app bundle is loaded and after reading a file.

🤖 Generated with Claude Code

@simboss simboss added the New Feature used for new functionalities label Oct 23, 2026
@cla-bot

cla-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

In order to contribute to the MapStore project, the CLA (Contributor License agreement) should be sent signed to GeoSolutions. Please consult contributing rules at: https://github.com/geosolutions-it/MapStore2/wiki/Contributing-to-MapStore#contributing-code

@offtherailz
offtherailz self-requested a review October 23, 2026 10:37
@offtherailz offtherailz self-assigned this Oct 23, 2026
@offtherailz offtherailz added this to the 2026.03.00 milestone Oct 23, 2026
@tdipisa tdipisa mentioned this pull request Oct 23, 2026
3 of 12 tasks
@cla-bot

cla-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

In order to contribute to the MapStore project, the CLA (Contributor License agreement) should be sent signed to GeoSolutions. Please consult contributing rules at: https://github.com/geosolutions-it/MapStore2/wiki/Contributing-to-MapStore#contributing-code

@cla-bot cla-bot Bot added the CLA Ready label Oct 26, 2026
@offtherailz
offtherailz force-pushed the codex/vanilla-privacy-consent branch from 09173d2 to 00e6a32 Compare October 26, 2026 17:14
@offtherailz
offtherailz changed the base branch from 2026.03.xx to master October 26, 2026 17:14
@offtherailz

offtherailz commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

The PR now targets master (backport to 2026.03.xx after the merge). In short, this is how the policy pages work now:

  1. Default: MapStore ships template pages in product/assets/privacy (Cookie Policy with the inventory of the default configuration, Privacy Policy, Terms of Use). The panel links them only when nothing else configures a page. While they are in use, the panel shows a warning to every user with a link to the documentation, the console logs a warning, and each page says that it is a template.
image
  1. The warning goes away when the installation does one of these:
    • disables the panel with "privacy": {"enabled": false} (for example outside the EU, or with a custom consent plugin);
    • installs a privacy settings extension created from mapstore-privacy-settings-extension;
    • configures privacy.links in localConfig.json (also through localConfig.json.patch), for example to edited copies of the templates.
  2. Precedence: privacy.links in localConfig.json, then the extension, then the templates.
  3. Languages: links can be set by locale, with the first one as fallback; the extension does the same with locales and assets/<locale>/. The panel texts can be replaced from the translations folder of the extension or through translationsPath.
  4. Projects: the project template copies the template pages into the WAR; existing projects add the same execution to web/pom.xml (see the migration guide) or configure privacy.links.

Checked on a WAR built from this branch: template pages and warning on first visit; public template extension and an operator extension installed and removed, with the warning gone and back.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Ready New Feature used for new functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shared privacy settings and consent management to MapStore Vanilla

2 participants