-
Notifications
You must be signed in to change notification settings - Fork 44.2k
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
feat(platform): List and revoke credentials in user profile #8207
base: master
Are you sure you want to change the base?
feat(platform): List and revoke credentials in user profile #8207
Conversation
✅ Deploy Preview for auto-gpt-docs canceled.
|
✅ Deploy Preview for auto-gpt-docs canceled.
|
…ke-oauth-permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be integrated with the credentials manager and its locking mechanism introduced in #8191, depending on which PR gets merged first.
response_data.detail, | ||
response, | ||
response.status, | ||
response.statusText, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik response_data.detail == response.statusText
for non-ok responses. I've changed it to print response
only - that contains everything and const response_data = await response.json();
isn't needed.
//TODO: Remove this once we have more providers | ||
delete providers["notion"]; | ||
delete providers["google"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
{/* <Alert className="mb-2 mt-2"> | ||
<AlertDescription>Heads up!</AlertDescription> | ||
<AlertDescription> | ||
<p> | ||
You need to manually remove credentials from the Notion after | ||
deleting them here, see{" "} | ||
</p> | ||
<a href="https://www.notion.so/help/add-and-manage-connections-with-the-api#manage-connections-in-your-workspace"> | ||
Notion documentation | ||
</a> | ||
</AlertDescription> | ||
</Alert> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's scalable to do this here for every single provider that doesn't have a revocation endpoint. A general note saying "Hey, you may also have to delete the connection with AutoGPT in your {provider} settings" would be plenty. Could be here or in the documentation for the platform.
Or raise HTTP 501 in the handler or the endpoint and get the message from there.
Bottom line: minimal differentiation per provider in the front end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I return 501 and displayed information in toast.
...(hasRequestBody && { "Content-Type": "application/json" }), | ||
...(token && { Authorization: `Bearer ${token}` }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know you could do this :)
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Background
Follow up to #8044
Resolves:
Changes 🏗️
Display existing credentials (OAuth and API keys) for all current providers: Google, Github, Notion and allow user to remove them (OAuth is also revoked at providers for Google and GitHub).
Remove
button inapp/profile/page.tsx
revoke_tokens
abstract method toBaseOAuthHandler
and implement it in each providerDELETE
/{provider}/credentials/{cred_id}
autogpt-server-api/baseClient.ts:_request
to properly handle empty server responsesgoogle
andnotion
providers at profile until implemented (addedTODO
)Testing 🔍
Note
Only for the new autogpt platform, currently in autogpt_platform/