Skip to content
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

add google sheets data source in settings page #28

Merged
merged 11 commits into from
Sep 12, 2024
Merged

Conversation

shekharnwagh
Copy link
Contributor

@shekharnwagh shekharnwagh commented Sep 2, 2024

Description

This PR adds a new type of data source in Settings Page - Google Sheets. It uses service accounts to authenticate and fetch data from Google Sheets. This is the first data source which uses OAuth2.0 to authenticate.

The flow for adding a Google Sheet data source is as follows:

  • Go the Google Cloud Console and create a new project (or select an existing one)
  • Enable the Google Sheets and Drive API (required to list spreadsheets) for the project
  • Create a new service account for the project
  • Add a new key to the service account and download the JSON key file
  • Grab the email address of the service account and grant that email address access to the spreadsheet you want to use
  • Go to the Settings Page for Remote Data Blocks, click on "Add Data Source" and select the "Google Sheets"
  • Enter the downloaded JSON key file contents in the "Credentials" field
  • The service account credentials are used to generate an access token which is used to fetch the list of spreadsheets which the service account has access to and the list of sheets in the selected spreadsheet
  • Select the spreadsheet and sheet you want to use and click on "Save" which will save the data source

Currently the saved data sources configured in the Settings Page are not hooked up with the registered blocks.

A separate PR will be made to add an example blocks for Google Sheets data source.

@shekharnwagh shekharnwagh self-assigned this Sep 2, 2024
@shekharnwagh shekharnwagh force-pushed the add/google-oauth branch 2 times, most recently from e8c9c37 to 49ee8e8 Compare September 4, 2024 11:03
@shekharnwagh shekharnwagh changed the title [WIP] add google sheets integration add google sheets data source in settings page Sep 6, 2024
@shekharnwagh shekharnwagh marked this pull request as ready for review September 6, 2024 16:52
Copy link
Contributor

@maxschmeling maxschmeling left a comment

Choose a reason for hiding this comment

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

Works great!

Maybe a few additional code comments that could be useful, but we can improve on that as we continue working on this.

@shekharnwagh shekharnwagh merged commit 923fc35 into trunk Sep 12, 2024
5 checks passed
@shekharnwagh shekharnwagh deleted the add/google-oauth branch September 12, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants