appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.95k stars 3.66k forks source link

[Feature]-[1032]:gsheets unauthorised datasaource, but query successful #17443

Open rohan-arthur opened 1 year ago

rohan-arthur commented 1 year ago

Is there an existing issue for this?

Description

This is a weird scenario - consider I want to remove accesses to my ghseets in all the applications within the workspace. So I go and un-authorise the datasource, and then expect the queries to fail, but they don't.

Steps To Reproduce

Steps:

  1. Create a valid gsheets datasource
  2. Create a select query on top of this, test that it runs properly
  3. Go back to the datasource, and click reauthorise, but in the google auth popup, click Cancel to simulate auth failre
  4. Check that the datasource now is in unauthorised state
  5. Go back and run the query Expected: the query should fail with auth error Actual: the query runs successfully

Public Sample App

No response

Version

Cloud

rohan-arthur commented 1 year ago

6m usage of gsheets: 2585 assume 5% run into this: 129

Stats

Stat Values
Reach 129
Effort (months) 0.25
daaliachhak17 commented 2 months ago

created a jira ticket-https://zemoso.atlassian.net/browse/TNOSB-358

AnnaHariprasad5123 commented 2 months ago

I started working on it. @contributor-support

AnnaHariprasad5123 commented 2 months ago

HI @rohan-arthur, @NilanshBansal. This is my solution approach.

Approach to solve

  1. Track the authentication status of the data source.
  2. Verify the authentication before running a query each time.
    • If authentication fails:
      • Display an error message: "Datasource is not authenticated."
    • If authentication is successful:
      • Run the query as usual.

I'm having difficulty understanding how connections are established and validated for each query execution for google sheets within the code base. Could you provide some guidance or suggest where I should start to get a clearer picture?

NilanshBansal commented 2 months ago

Hey @AnnaHariprasad5123 can you please pick up some issues with the label Inviting Contribution. The current issue is not under that list. The list can be found here: https://github.com/appsmithorg/appsmith/issues?q=is%3Aopen+is%3Aissue+label%3A%22Inviting+Contribution%22 Also, you can tag @appsmithorg/contributor-support before starting work on any issue. cc: @rohan-arthur @carinanfonseca