Problem/Motivation
The keepeek/keepeek_library is loaded unconditionally into keepeek_preprocess_page, and the complete original Keepeek configuration is also pushed under drupalSettings.keepeek. This data (including API credentials) is therefore accessible on all pages, whether public or admin, which might be considered as a security issue. This also results in an unnecessary overhead of 1.6 MB on public routes.
Steps to reproduce
With Keepeek module enabled, while browsing any page, open the browser's dev tools and check for the presence of the resource https://cdn.jsdelivr.net/npm/@keepeek/keepicker-react@1/dist/index.min.js. In the console, you can also inspect the content of drupalSettings.keepeek and, by editing the DOM, add the kpk-keepicker web component and observe its initialization.
Proposed resolution
I suggest removing keepeek_preprocess_page in favor of loading keepeek/keepeek_library and setting drupalSettings.keepeek on KeepeekMediaForm build.
Issue fork keepeek-3558769
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
alex.druhetComment #4
keepeek_dam commentedComment #6
keepeek_dam commented