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

feat: add support to use PATs instead of OAuth #361

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

thedadams
Copy link
Contributor

@thedadams thedadams commented Jan 22, 2025

Tools will now be able to specify, in their metadata, that their OAuth credential supports personal access tokens with the oauthPATSupported field being "true". If a tool does this, then the OAuth credential will prompt the user for a PAT instead of going through the OAuth flow.

This change includes this field on the GitHub and Atlassian tools.

Lastly, this change removes support for OAuth outside Obot. The OAuth credential tool will no longer look at the CLI config nor default to use the Gateway.

Issue: obot-platform/obot#1372

oauth2/main.go Outdated
defer g.Close()

run, err := g.Run(context.Background(), "sys.prompt", gptscript.Options{
Input: fmt.Sprintf(`{"metadata": %s,"message":"Please enter your personal access token for %s.","fields":"Token","sensative": true}`, b, integration),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Input: fmt.Sprintf(`{"metadata": %s,"message":"Please enter your personal access token for %s.","fields":"Token","sensative": true}`, b, integration),
Input: fmt.Sprintf(`{"metadata": %s,"message":"Please enter your personal access token for %s.","fields":"Token","sensitive": true}`, b, integration),

If this typo exists on the gptscript end, then it should be fixed there too.

@thedadams thedadams requested a review from g-linville January 22, 2025 19:54
@thedadams
Copy link
Contributor Author

Pushed a change in design (in a new commit), so requesting reviews.


---
!metadata:*:supportsOAuthTokenPrompt
Copy link
Member

Choose a reason for hiding this comment

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

The description of this PR references an oauthPATSupported field. The field here is named differently. Is this intentional?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's changed in this PR obot-platform/obot#1387

Tools will now be able to specify, in their metadata, that their OAuth
credential supports personal access tokens with the oauthPATSupported
field being "true". If a tool does this, then the OAuth credential will
prompt the user for a PAT instead of going through the OAuth flow.

This change includes this field on the GitHub and Atlassian tools.

Lastly, this change removes support for OAuth outside Obot. The OAuth
credential tool will no longer look at the CLI config nor default to use
the Gateway.

Signed-off-by: Donnie Adams <[email protected]>
Signed-off-by: Donnie Adams <[email protected]>
@thedadams thedadams force-pushed the oauth-pat-token-support branch from af7df7d to 400d33b Compare January 29, 2025 23:52
@thedadams thedadams merged commit eda592f into obot-platform:main Jan 30, 2025
1 check passed
@thedadams thedadams deleted the oauth-pat-token-support branch January 30, 2025 00:15
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.

4 participants