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 lookupsrc/services/fileProtect/uploadHandlers/sharepoint.pipe.ts- Pass site and drive through the upload, stop calling sharessrc/utils/sharepointUrl.ts- Parse a library URL, match a drive, encode the item pathsrc/utils/sharepointUrl.test.ts- URL parsing and drive matchingsrc/utils/sharepoint.ts- Remove the unused shares encoderpackage.json- Run everysrc/**/*.test.tsfiletsconfig.json- Exclude test files from the app compile.gitlab-ci.yml- Runnpm testin ateststage before the build