Skip to main content
Version: 4.38.0

feat-sharepoint-sites-selected

🔒 Security​

[SharePoint upload without the shares API]​

Goal: A Box connected with the Sites.Selected permission can still deposit into a SharePoint library. The shares API refuses that permission, even on a site that was explicitly granted.

Solution: Resolve the library URL through the site, then the drive, and upload on that site-scoped path. Tags and the hash are written from the drive list and the uploaded item id.

Features:

  • Library URLs under /sites/ keep working with the current broad Graph permission and with Sites.Selected once that site is granted
  • A sharing link is rejected, with a message asking for the library URL

Files Modified:

  • src/protocol/microsoftApi.ts - Site and drive resolution, site-scoped upload session, list lookup
  • src/services/fileProtect/uploadHandlers/sharepoint.pipe.ts - Pass site and drive through the upload, stop calling shares
  • src/utils/sharepointUrl.ts - Parse a library URL, match a drive, encode the item path
  • src/utils/sharepointUrl.test.ts - URL parsing and drive matching
  • src/utils/sharepoint.ts - Remove the unused shares encoder
  • package.json - Run every src/**/*.test.ts file
  • tsconfig.json - Exclude test files from the app compile
  • .gitlab-ci.yml - Run npm test in a test stage before the build