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

Re-run credential tools when scopes change #833

Open
g-linville opened this issue Aug 30, 2024 · 0 comments
Open

Re-run credential tools when scopes change #833

g-linville opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@g-linville
Copy link
Member

Say I have a tool that includes this:

credentials: github.com/gptscript-ai/gateway-oauth2 as myCredential with ASDF as env and "scope1 scope2" as scope and whatever as integration

When the user authenticates, their credential will have the scopes scope1 and scope2.

If I go to run the tool again later, but need an additional scope, scope3, even when I have updated it to this:

credentials: github.com/gptscript-ai/gateway-oauth2 as myCredential with ASDF as env and "scope1 scope2 scope3" as scope and whatever as integration

it will still reuse the existing myCredential from the credential store. The only way to get around this right now is for the user to delete their existing credential.

When we go to fetch a credential from the store, we need to find a way to check the requested scopes against existing scopes. Right now, the credential framework does not store the scopes for OAuth tools, but it does store refresh tokens. We probably need to follow the same pattern and start storing scopes and then comparing them.

@cjellick cjellick added the enhancement New feature or request label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants