Skip to content

✨ Source Microsoft Sharepoint: Make refresh token optional #37372

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 7 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 59353119-f0f2-4e5a-a8ba-15d887bc34f6
dockerImageTag: 0.2.2
dockerImageTag: 0.2.3
dockerRepository: airbyte/source-microsoft-sharepoint
githubIssueLabel: source-microsoft-sharepoint
icon: microsoft-sharepoint.svg
Expand Down
925 changes: 499 additions & 426 deletions airbyte-integrations/connectors/source-microsoft-sharepoint/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.2.2"
version = "0.2.3"
name = "source-microsoft-sharepoint"
description = "Source implementation for Microsoft SharePoint."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def spec(self, *args: Any, **kwargs: Any) -> ConnectorSpecification:
oauth_user_input_from_connector_config_specification={
"type": "object",
"additionalProperties": False,
"properties": {"tenant_id": {"type": "string", "path_in_connector_config": ["credentials", "tenant_id"]}},
"properties": {
"tenant_id": {"type": "string", "path_in_connector_config": ["credentials", "tenant_id"]},
"grant_type": {"type": "string", "path_in_connector_config": ["credentials", "grant_type"]},
},
},
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Config:

# Fields for the OAuth authentication, including tenant_id, client_id, client_secret, and refresh_token
auth_type: Literal["Client"] = Field("Client", const=True)
grant_type: str = Field(
title="OAuth Type",
description="Determines the OAuth grant type for authentication. 'authorization_code' allows access via refresh tokens. 'client_credentials' uses only the client ID and secret for authentication.",
default="authorization_code",
enum=["authorization_code", "client_credentials"],
)

tenant_id: str = Field(title="Tenant ID", description="Tenant ID of the Microsoft SharePoint user", airbyte_secret=True)
client_id: str = Field(
title="Client ID",
Expand Down
15 changes: 8 additions & 7 deletions docs/integrations/sources/microsoft-sharepoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This page contains the setup guide and reference information for the Microsoft S
5. Enter **Drive Name**. To find your drive name go to settings and at the top of setting menu you can find the name of your drive.
6. Select **Search Scope**. Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' for all SharePoint drives the user can access, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both. Default value is 'ALL'.
7. Enter **Folder Path**. Leave empty to search all folders of the drives. This does not apply to shared items.
8. The **OAuth2.0** authorization method is selected by default. Click **Authenticate your Microsoft SharePoint account**. Log in and authorize your Microsoft account.
8. The **OAuth2.0** authorization is selected by default for authentication. You have the option to choose the `grant_type`: `authorization_code`, which uses a refresh token to maintain access without frequent re-authorizations, or `client_credentials`, which does not require a refresh token. After selecting the desired grant type, click **Authenticate your Microsoft SharePoint account**, log in, and authorize your Microsoft account to connect it with Airbyte.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it tested manually?

I think we hide all logic in the UI by one button and all data inputs from DB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tested it locally.

9. For **Start Date**, enter the date in YYYY-MM-DD format. The data added on and after this date will be replicated.
10. Add a stream:
1. Write the **File Type**
Expand Down Expand Up @@ -129,11 +129,12 @@ The connector is restricted by normal Microsoft Graph [requests limitation](http

## Changelog

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:--------------------------|
| 0.2.2 | 2024-03-28 | [36573](https://github.com/airbytehq/airbyte/pull/36573) | Update QL to 400 |
| 0.2.1 | 2024-03-22 | [36381](https://github.com/airbytehq/airbyte/pull/36381) | Unpin CDK |
| 0.2.0 | 2024-03-06 | [35830](https://github.com/airbytehq/airbyte/pull/35830) | Add fetching shared items |
| 0.1.0 | 2024-01-25 | [33537](https://github.com/airbytehq/airbyte/pull/33537) | New source |
| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------|
| 0.2.3 | 2024-04-17 | [37372](https://github.com/airbytehq/airbyte/pull/37372) | Add grant-type `client_credentials` For OAuth2 Flow |
| 0.2.2 | 2024-03-28 | [36573](https://github.com/airbytehq/airbyte/pull/36573) | Update QL to 400 |
| 0.2.1 | 2024-03-22 | [36381](https://github.com/airbytehq/airbyte/pull/36381) | Unpin CDK |
| 0.2.0 | 2024-03-06 | [35830](https://github.com/airbytehq/airbyte/pull/35830) | Add fetching shared items |
| 0.1.0 | 2024-01-25 | [33537](https://github.com/airbytehq/airbyte/pull/33537) | New source |

</HideInUI>
Loading