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

google drive tool: new endpoint for google drive tool auth deletion #654

Merged

Conversation

chantelle-cohere
Copy link
Contributor

@chantelle-cohere chantelle-cohere commented Aug 13, 2024

Description

This PR adds a new endpoint which handles deleting google drive tool auth.
HTTP Request Method: DELETE
Path: /v1/tool/auth
Request Body:

{
    "tool_id": "<tool_id_to_be_deleted>"
}

Note that currently, the only supported tool_id is google_drive.

Expected Response:

{
    "status": "success"
}

Issue

fix TLK-875

Dependencies

None

TODO

  • Add tests and docs: Please include testing and documentation for your changes

AI Description

This PR introduces a new endpoint for deleting tool authentication and updates the GoogleDriveAuth class to include a delete_tool_auth method.

Summary

The changes in this PR allow for the deletion of tool authentication, specifically for Google Drive. The new endpoint, /tool/auth, is added to the router in src/backend/routers/auth.py. It defines the logic for removing the corresponding ToolAuth from the database for the requesting user. Additionally, the GoogleDriveAuth class in src/backend/tools/google_drive/auth.py is updated to include a delete_tool_auth method, which handles the deletion process.

Changes

  • Introduce a new endpoint, /tool/auth, for deleting tool authentication.
  • Implement the delete_tool_auth method in the GoogleDriveAuth class.

Copy link

cla-assistant bot commented Aug 13, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

cla-assistant bot commented Aug 13, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch from d35eb25 to ea3e8e2 Compare August 13, 2024 19:47
@chantelle-cohere
Copy link
Contributor Author

The new endpoint currently returns {"status": "success"} on successful tool auth deletion. Should it return anything else?
CC @tomtobac / @knajjars / @BeatrixCohere

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 28 lines in your changes missing coverage. Please review.

Project coverage is 74.58%. Comparing base (14c77f2) to head (2f9d084).
Report is 1 commits behind head on main.

Files Patch % Lines
src/backend/routers/auth.py 16.66% 20 Missing ⚠️
src/backend/tools/base.py 14.28% 6 Missing ⚠️
...ckend/services/logger/strategies/structured_log.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #654   +/-   ##
=======================================
  Coverage   74.58%   74.58%           
=======================================
  Files         256      258    +2     
  Lines       11057    11136   +79     
=======================================
+ Hits         8247     8306   +59     
- Misses       2810     2830   +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch 2 times, most recently from d6417c2 to 49b6563 Compare August 14, 2024 18:18
@chantelle-cohere chantelle-cohere marked this pull request as ready for review August 14, 2024 18:19
Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

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

Some small requests

@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch from 8e2631a to 53b0242 Compare August 14, 2024 19:31
Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@lusmoura lusmoura left a comment

Choose a reason for hiding this comment

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

LGTM! Left one comment and would appreciate it if you could add a couple of unit tests

src/backend/services/logger/utils.py Outdated Show resolved Hide resolved
src/backend/tools/base.py Outdated Show resolved Hide resolved
src/backend/routers/auth.py Show resolved Hide resolved
@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch 2 times, most recently from a33aef2 to bad911b Compare August 15, 2024 22:14
@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch from bad911b to f24d8ff Compare August 15, 2024 22:18
@chantelle-cohere chantelle-cohere force-pushed the chantelle/tlk-875-delete-auth-for-tools-endpoint branch from f24d8ff to 2f9d084 Compare August 15, 2024 22:27
@chantelle-cohere chantelle-cohere added this pull request to the merge queue Aug 15, 2024
Merged via the queue into main with commit b5f2991 Aug 15, 2024
6 checks passed
@chantelle-cohere chantelle-cohere deleted the chantelle/tlk-875-delete-auth-for-tools-endpoint branch August 15, 2024 22:34
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.

6 participants