Table of Contents

SharePoint Online connector

Store in SharePoint, through Microsoft Graph, the email and attachments of each drop.

Important

Example to adapt, not working as is. In this version, the Graph address of the upload session is malformed (.../v1.0/sites{host}/..., without a slash after sites): the folder is created, then the file upload fails. Fix the connector, or move its logic into a handler, and test it before any use.

Identifier sharepoint
Address https://<server>/api/webhook/sharepoint

Settings and secrets

Where Key Effect
Connector:sharepoint SiteUrl Site address. Only its host name is used: the site path is ignored, and files go to the default library of the root site.
Connector:sharepoint DocumentLibrary Read by no code in this version.
Connectors.sharepoint.Secrets TenantId, ClientId, ClientSecret Microsoft Entra ID app registration, with a client secret.
Connectors.sharepoint.Secrets PrivateAESKey Required, in the <key>_<IV> format: the same as in the SESAR configuration. The template does not provide it at this location. Without it, the connector's initialization fails.

The app registration needs a Microsoft Graph application permission on files or sites, with an administrator's consent. Choose the most restricted permission that fits, for example Sites.Selected with access granted to the target site only.

What it does

  1. It obtains a token for Microsoft Graph (https://graph.microsoft.com/.default), through the client credentials flow.
  2. It creates a folder named after the drop's subject.
  3. It reads the drop's email (EmailSent.html in the drop's folder on the SESAR server), decrypting it with PrivateAESKey if needed, then turns it into an EmailSent.eml file that it uploads.
  4. It decrypts each attachment encrypted by SESAR and uploads it under its original name, in 10 MiB chunks.
  5. It deletes the decrypted copies.

The connector reads the files at the manifest's paths: the application must run on a machine with access to SESAR's storage.

Limits to fix before use

  • The upload session address is malformed.
  • Microsoft Graph responses are not checked: the connector answers "Manifest Processed" even if an upload failed.
  • Upload chunks overlap by one byte, which compromises files larger than 10 MiB.
  • On an exception, the decrypted copies of the email and attachments remain on the SESAR server's disk.
  • The site path and DocumentLibrary are ignored.

Test

POST /api/connectors/sharepoint/test only checks that a token can be obtained, without calling SharePoint.