-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[WorkplaceAI] SharePoint Online stack connector #248737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e2e18cb
init w/scaffolding
mattnowzari e50094b
Baseline working, WIP otherwise
mattnowzari 7efc7f0
Added Sean's tests as a baseline
mattnowzari 41e6493
3 new actions added and working
mattnowzari f3928d5
Greatly improved test cases
mattnowzari 7700737
Cleaned up connector code a bit
mattnowzari 46958e0
Added new action getSiteDrives + tests
mattnowzari c5d3ac1
getSiteLists action added + tests
mattnowzari 322b773
New action getSiteListItems added + tests
mattnowzari 4a0db01
Added simple output schema + some code to allow the YAML editor UI to…
mattnowzari 0a77319
Merge branch 'main' into sharepoint_online
mattnowzari 86f5daa
Merge branch 'main' into sharepoint_online
mattnowzari f09ddcb
Merge branch 'main' into sharepoint_online
mattnowzari 3f296e9
Added select params to cut down on response sizes + added a new actio…
mattnowzari f4abeca
Pagination support + tests update
mattnowzari 2907dd7
Merge branch 'main' into sharepoint_online
mattnowzari b312489
Fix bad merge conflict resolve
mattnowzari 11a6c88
Merge branch 'main' into sharepoint_online
mattnowzari b3dad5c
Removed pagination, as it seems a little inconsistent from the Graph …
mattnowzari a92bc9c
Merge branch 'main' into sharepoint_online
mattnowzari bdb615c
Added getDriveItems and downloadDriveItems
mattnowzari c3f4f43
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine de2adb2
Appease the linter
mattnowzari bf121c2
Addressed feedback, added new action downloadItemFromURL + simplified…
mattnowzari 109116d
Merge branch 'main' into sharepoint_online
mattnowzari d9750c3
Added a new action, getSitePageContents
mattnowzari 874e7e9
Updated docs too
mattnowzari fcb3289
move sharepoint link to correct snippet
florent-leborgne 16bd5bc
Fixed Search action, as apparently Region is required for it to work
mattnowzari 582ab74
Region for Search action now is z.enum() for better validation
mattnowzari 2228996
Merge branch 'main' into sharepoint_online
mattnowzari 2cef8ae
Removing schema code for now, as it's not necessary for the connector…
mattnowzari ffa2f08
Remove errant import
mattnowzari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/reference/connectors-kibana/_snippets/elastic-connectors-list.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| * [Cases](/reference/connectors-kibana/cases-action-type.md): Add alerts to [Cases](docs-content://explore-analyze/alerts-cases/cases.md). | ||
| * [Index](/reference/connectors-kibana/index-action-type.md): Index data into Elasticsearch. | ||
| * [Observability AI Assistant](/reference/connectors-kibana/obs-ai-assistant-action-type.md): Send alerts to the AI Assistant. | ||
| * [ServerLog](/reference/connectors-kibana/server-log-action-type.md): Add a message to a Kibana log. | ||
| * [ServerLog](/reference/connectors-kibana/server-log-action-type.md): Add a message to a Kibana log. |
132 changes: 132 additions & 0 deletions
132
docs/reference/connectors-kibana/sharepoint-online-action-type.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| --- | ||
| navigation_title: "SharePoint Online" | ||
| mapped_pages: | ||
| - https://www.elastic.co/guide/en/kibana/current/sharepoint-online-action-type.html | ||
| applies_to: | ||
| stack: preview 9.4 | ||
| serverless: preview | ||
| --- | ||
|
|
||
| # SharePoint Online connector [sharepoint-online-action-type] | ||
|
|
||
| The SharePoint Online connector enables federated search capabilities across SharePoint sites, pages, and content using the Microsoft Graph API. | ||
|
|
||
| ## Create connectors in {{kib}} [define-sharepoint-online-ui] | ||
|
|
||
| You can create connectors in **{{stack-manage-app}} > {{connectors-ui}}**. | ||
|
|
||
| ### Connector configuration [sharepoint-online-connector-configuration] | ||
|
|
||
| SharePoint Online connectors have the following configuration properties: | ||
|
|
||
| Token URL | ||
| : The OAuth 2.0 token endpoint URL. Use the format: `https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token` | ||
|
|
||
| Client ID | ||
| : The application (client) ID from your Microsoft Entra app registration. | ||
|
|
||
| Client Secret | ||
| : The client secret generated for your Microsoft Entra application. | ||
|
|
||
|
|
||
| ## Test connectors [sharepoint-online-action-configuration] | ||
|
|
||
| You can test connectors as you're creating or editing the connector in {{kib}}. The test verifies connectivity by accessing the root SharePoint site. | ||
|
|
||
| The SharePoint Online connector has the following actions: | ||
|
|
||
| Search | ||
| : Search for content across SharePoint sites, lists, and drives using Microsoft Graph Search API. | ||
| - **query** (required): The search query string. | ||
| - **entityTypes** (optional): Array of entity types to search. Valid values: `site`, `list`, `listItem`, `drive`, `driveItem`. Defaults to `site`. | ||
| - **region** (optional): Search region (`NAM`, `EUR`, `APC`, `LAM`, `MEA`). Defaults to `NAM`. | ||
| - **from** (optional): Offset for pagination. | ||
| - **size** (optional): Number of results to return. | ||
|
|
||
| Get all sites | ||
| : List all SharePoint sites. | ||
|
|
||
| Get site | ||
| : Get a single site by ID or relative URL. | ||
| - **siteId** (optional): Site ID. | ||
| - **relativeUrl** (optional): Relative URL path (for example, `contoso.sharepoint.com:/sites/site-name`). | ||
|
|
||
| Get site pages | ||
| : List pages for a site. | ||
| - **siteId** (required): The site ID. | ||
|
|
||
| Get site page contents | ||
| : Get page content (including `canvasLayout`) for a site page. | ||
| - **siteId** (required): The site ID. | ||
| - **pageId** (required): The page ID. | ||
|
|
||
| Get site drives | ||
| : List drives for a site. | ||
| - **siteId** (required): The site ID. | ||
|
|
||
| Get site lists | ||
| : List lists for a site. | ||
| - **siteId** (required): The site ID. | ||
|
|
||
| Get site list items | ||
| : List items for a site list. | ||
| - **siteId** (required): The site ID. | ||
| - **listId** (required): The list ID. | ||
|
|
||
| Get drive items | ||
| : List items in a drive by `driveId` (optionally by path). Returns metadata including `@microsoft.graph.downloadUrl`. | ||
| - **driveId** (required): The drive ID. | ||
| - **path** (optional): Path relative to drive root. | ||
|
|
||
| Download drive item (text) | ||
| : Download a drive item by `driveId` and `itemId`, returning text content only. | ||
| - **driveId** (required): The drive ID. | ||
| - **itemId** (required): The drive item ID. | ||
|
|
||
| Download item from URL | ||
| : Download item content from a pre-authenticated `downloadUrl`, returning text. | ||
| - **downloadUrl** (required): A pre-authenticated download URL. | ||
|
|
||
| Call Graph API | ||
| : Call a Microsoft Graph v1.0 endpoint by path only. | ||
| - **method** (required): HTTP method, `GET` or `POST`. | ||
| - **path** (required): Graph path starting with `/v1.0/` (for example, `/v1.0/me`). | ||
| - **query** (optional): Query parameters (for example, `$top`, `$filter`). | ||
| - **body** (optional): Request body (for `POST`). | ||
|
|
||
| Recommended flow | ||
| : Use `getDriveItems` to fetch metadata and `downloadUrl`, decide which items are worth retrieving, then call `downloadItemFromURL` for the selected items. This avoids extra round trips just to fetch download metadata. | ||
|
|
||
|
|
||
| ## Get API credentials [sharepoint-online-api-credentials] | ||
|
|
||
| To use the SharePoint Online connector, you need to: | ||
|
|
||
| 1. Register an application in Microsoft Entra (Azure AD): | ||
| - Go to the [Azure Portal](https://portal.azure.com/) | ||
| - Navigate to **Microsoft Entra ID** > **App registrations** | ||
| - Click **New registration** | ||
| - Provide a name for your application | ||
| - Select **Accounts in this organizational directory only** | ||
| - Click **Register** | ||
|
|
||
| 2. Configure API permissions: | ||
| - In your app registration, go to **API permissions** | ||
| - Click **Add a permission** > **Microsoft Graph** > **Application permissions** | ||
| - Add the following permissions: | ||
| - `Sites.Read.All` - Read items in all site collections | ||
| - `Sites.ReadWrite.All` - Read and write items in all site collections (if write operations needed) | ||
| - Click **Grant admin consent** for your organization | ||
|
|
||
| 3. Create a client secret: | ||
|
mattnowzari marked this conversation as resolved.
|
||
| - In your app registration, go to **Certificates & secrets** | ||
| - Click **New client secret** | ||
| - Provide a description and select an expiration period | ||
| - Click **Add** | ||
| - Copy the secret value immediately (it won't be shown again) | ||
|
|
||
| 4. Gather the following information for the connector configuration: | ||
| - **Tenant ID**: Found in **Overview** section of your app registration (needed for Token URL) | ||
| - **Token URL**: Construct using the format `https://login.microsoftonline.com/{your-tenant-id}/oauth2/v2.0/token` | ||
| - **Client ID**: Found in **Overview** section (also called Application ID) | ||
| - **Client Secret**: The value you copied in step 3 (this is the only sensitive field) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/platform/packages/shared/kbn-connector-specs/src/specs/sharepoint_online/icon/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| import { EuiIcon } from '@elastic/eui'; | ||
| import type { ConnectorIconProps } from '../../../types'; | ||
| import sharepointIcon from './sharepoint.svg'; | ||
|
|
||
| export default (props: ConnectorIconProps) => { | ||
| return <EuiIcon type={sharepointIcon} {...props} />; | ||
| }; |
1 change: 1 addition & 0 deletions
1
...ages/shared/kbn-connector-specs/src/specs/sharepoint_online/icon/sharepoint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.