-
Notifications
You must be signed in to change notification settings - Fork 1
Adds Google Drive OAuth support #75
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
Conversation
| const authInfo = authContextStore.get(sessionId); | ||
|
|
||
| if (authInfo && (authInfo.atlassian || authInfo.figma)) { | ||
| if (authInfo && (authInfo.atlassian || authInfo.figma || authInfo.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.
I think we should do some cleanup to make our auth providers more abstract and code like this just loops through them.
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 would suggest creating a new ticket to improve the overall authentication code. I would rather not add new code to the current implementation on this MR. Do you mind creating a ticket and assigning it to me?
|
|
||
| if (googleTokens && googleTokens.access_token && googleTokens.refresh_token) { | ||
| console.log(' Adding Google credentials to JWT'); | ||
| multiProviderTokens.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.
similar here, this code is the same for each provider
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.
Same as before. This can be added to the next ticket for authentication improvement.
| <div class="provider ${connectedProviders.includes('google') ? 'connected' : ''}"> | ||
| <h2>Google Drive</h2> | ||
| <p>Access Google Drive files and user information</p> |
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.
probably just "google drive" files
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.
Addressed
| async refreshAccessToken( | ||
| params: RefreshTokenParams | ||
| ): Promise<StandardTokenResponse> { | ||
| const clientId = process.env.GOOGLE_CLIENT_ID!; |
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 think we need to update the contributing docs and point people where to create a google_client_id and such.
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.
Will be addressed on https://bitovi.atlassian.net/browse/FE-721
TICKET: https://bitovi.atlassian.net/browse/FE-662
This pull request adds support for Google Drive as a new OAuth provider throughout the authentication and token management flow. The changes ensure Google credentials are handled alongside existing Atlassian and Figma providers, including connection, token refresh, JWT creation/validation, and provider registration. The update also introduces a Google API client for authenticated requests.
Google Drive provider integration:
googleas an optional provider in theAuthContext,MultiProviderTokens, and related type definitions, enabling storage and handling of Google OAuth tokens. [1] [2]Token refresh and management:
Provider registration and API client:
google-api-client.tsfile implementing a Google API client for authenticated requests using OAuth tokens, including a method to fetch user info from the Drive API.Error handling and messaging:
These changes collectively enable Google Drive integration for authentication, session management, and API access within the existing multi-provider framework.