OneDrive connector - #1356
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Microsoft OneDrive connector to the Microsoft 365 connector suite, including sanitizer rules, example API responses, Terraform connector spec wiring, and end-user documentation.
Changes:
- Added OneDrive sanitizer rule sets (standard + “no app ids”) with example API responses and Java rule tests.
- Registered the new connector in Java prebuilt rules and Terraform connector specs (including example API call generation inputs).
- Updated docs navigation and Microsoft 365 docs to include OneDrive and guidance for populating example IDs.
Reviewed changes
Copilot reviewed 35 out of 39 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDriveTests.java | Adds Java rules tests for the OneDrive ruleset and example invocations. |
| java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDrive_NoAppIds_Tests.java | Adds Java rules tests for the OneDrive “no app ids” variant and example invocations. |
| java/core/src/main/java/co/worklytics/psoxy/rules/msft/PrebuiltSanitizerRules.java | Registers OneDrive rulesets and adds them to the default MSFT rules map. |
| infra/modules/worklytics-connectors-msft-365/variables.tf | Documents additional supported MSFT 365 connector settings keys (incl. OneDrive example IDs). |
| infra/modules/worklytics-connectors-google-workspace/main.tf | Terraform formatting/alignment tweak in locals. |
| infra/modules/worklytics-connector-specs/variables.tf | Documents additional supported MSFT 365 connector settings keys (incl. OneDrive example IDs). |
| infra/modules/worklytics-connector-specs/msft-365.tf | Adds connector spec entry for msft-onedrive (metadata, roles, example API calls). |
| infra/modules/worklytics-connector-specs/main.tf | Adds locals for OneDrive example IDs used in example API call generation. |
| infra/modules/google-workspace-dwd-connection/main.tf | Terraform formatting/alignment tweak in locals. |
| infra/modules/gcp-proxy-bulk/variables.tf | Terraform formatting tweak for variable type line. |
| infra/modules/gcp-host/main.tf | Terraform formatting/alignment tweak for module args. |
| infra/modules/entra-grant-all-users/main.tf | Updates Entra admin-center deep link used in instructions. |
| infra/examples-dev/gcp/msft-365-variables.tf | Documents additional supported MSFT 365 connector settings keys (incl. OneDrive example IDs). |
| infra/examples-dev/aws/msft-365-variables.tf | Documents additional supported MSFT 365 connector settings keys (incl. OneDrive example IDs). |
| docs/SUMMARY.md | Adds OneDrive page into the docs table of contents. |
| docs/sources/README.md | Adds msft-onedrive to the connector list. |
| docs/sources/microsoft-365/README.md | Adds guidance for populating Terraform-generated example API calls with real IDs. |
| docs/sources/microsoft-365/msft-onedrive/README.md | New connector documentation page for OneDrive (endpoints, scopes, examples, rules links). |
| docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml | New OneDrive ruleset YAML (standard mode). |
| docs/sources/microsoft-365/msft-onedrive/msft-onedrive_no-app-ids.yaml | New OneDrive ruleset YAML (“no app ids” mode). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/users.json | Adds original example response for /users. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/groups.json | Adds original example response for /groups. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/list_drives.json | Adds original example response for /users/{id}/drives and /groups/{id}/drives. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/get_drive_delta.json | Adds original example response for /drives/{id}/root/delta. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/list_itemActivity.json | Adds original example response for /drives/{id}/items/{id}/activities. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/original/list_driveActivity.json | Adds original example response for /drives/{id}/activities. |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/users.json | Adds sanitized example response for /users (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/groups.json | Adds sanitized example response for /groups (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/list_drives.json | Adds sanitized example response for drive listing (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/get_drive_delta.json | Adds sanitized example response for delta feed (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/list_itemActivity.json | Adds sanitized example response for per-item activities (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized/list_driveActivity.json | Adds sanitized example response for drive activities (standard rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/users.json | Adds sanitized example response for /users (no-app-ids rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/groups.json | Adds sanitized example response for /groups (no-app-ids rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/list_drives.json | Adds sanitized example response for drive listing (no-app-ids rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/get_drive_delta.json | Adds sanitized example response for delta feed (no-app-ids rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/list_itemActivity.json | Adds sanitized example response for per-item activities (no-app-ids rules). |
| docs/sources/microsoft-365/msft-onedrive/example-api-responses/sanitized_no-app-ids/list_driveActivity.json | Adds sanitized example response for drive activities (no-app-ids rules). |
| CHANGELOG.md | Adds an unreleased entry announcing the new msft-onedrive connector. |
Comments suppressed due to low confidence (10)
java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDriveTests.java:44
- The example URLs use
$orderBy, but Microsoft Graph uses$orderby(lowercase). Since allowed query params are checked case-sensitively, requests using$orderbywould be blocked unless rules include it. Consider using$orderbyin these examples (and allow it in the rules).
java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDriveTests.java:47 - This example URL ends the query string with a trailing
&, which introduces an empty query parameter key. The sanitizer's allowed-query-params check is strict and may reject this URL even thoughtokenis allowed.
java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDrive_NoAppIds_Tests.java:46 - These example URLs use
$orderBy, but Microsoft Graph uses$orderby(lowercase). Because the sanitizer checks allowed query params case-sensitively, allowing only$orderBywould block$orderbyrequests.
java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDrive_NoAppIds_Tests.java:49 - This example URL ends the query string with a trailing
&, which introduces an empty query parameter key and may be rejected by strict query-param allowlisting.
docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml:101 - Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) in addition to$orderByto match Microsoft Graph clients.
allowedQueryParams:
- "$select"
- "$skiptoken"
- "$top"
- "$orderBy"
docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml:126
- Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) in addition to$orderByto avoid blocking valid Microsoft Graph requests.
allowedQueryParams:
- "$top"
- "$select"
- "$skiptoken"
- "$orderBy"
docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml:157
- Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) alongside$orderByfor compatibility with common Microsoft Graph client usage.
allowedQueryParams:
- "$select"
- "$skiptoken"
- "$top"
- "$orderBy"
docs/sources/microsoft-365/msft-onedrive/msft-onedrive_no-app-ids.yaml:104
- Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) in addition to$orderByto match Microsoft Graph clients.
allowedQueryParams:
- "$select"
- "$skiptoken"
- "$top"
- "$orderBy"
docs/sources/microsoft-365/msft-onedrive/msft-onedrive_no-app-ids.yaml:130
- Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) alongside$orderByfor compatibility with common Microsoft Graph usage.
allowedQueryParams:
- "$top"
- "$select"
- "$skiptoken"
- "$orderBy"
docs/sources/microsoft-365/msft-onedrive/msft-onedrive_no-app-ids.yaml:162
- Allowed query params are checked case-sensitively; consider allowlisting
$orderby(lowercase) in addition to$orderByfor Microsoft Graph client compatibility.
allowedQueryParams:
- "$select"
- "$skiptoken"
- "$top"
- "$orderBy"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eschultink
left a comment
There was a problem hiding this comment.
i agree with the hardwraps in md; and casing in example urls (We should match MSFT docs)
aperez-worklytics
left a comment
There was a problem hiding this comment.
Some improvements in docs and adding support for ignoring case when matching query parameters
| .map(allowedParams -> allowedParams.containsAll( | ||
| queryParams.stream().map(Pair::getKey).collect(Collectors.toList()))) | ||
| .map(allowedParams -> { | ||
| Set<String> allowedParamsLowerCase = allowedParams.stream() |
There was a problem hiding this comment.
Adding this change to support ignoring case when checking query parameters
Features
Change implications
CHANGELOG.mdanything that will show up interraform plan/applythat isn'tobviously a no-op? no
alpha, requires major versionchange