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

Add support for GitHub App authentication #363

Merged
merged 18 commits into from
Sep 27, 2024
Merged

Conversation

gwdawson
Copy link
Member

@gwdawson gwdawson commented Sep 18, 2024

This PR adds the ability of authenticating with the github data source using GitHub Apps.

@gwdawson gwdawson self-assigned this Sep 18, 2024
@gwdawson gwdawson marked this pull request as ready for review September 19, 2024 10:05
@gwdawson gwdawson requested a review from a team as a code owner September 19, 2024 10:05
Copy link
Member

@ivanahuckova ivanahuckova left a comment

Choose a reason for hiding this comment

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

Yay! This works and was done really fast! 🚀 I left some comments, questions bellow. Let me know if anything is not clear.

pkg/github/client/client.go Outdated Show resolved Hide resolved
pkg/github/client/client.go Outdated Show resolved Hide resolved
src/views/ConfigEditor.tsx Outdated Show resolved Hide resolved
docs/sources/setup/token.md Outdated Show resolved Hide resolved
src/views/ConfigEditor.tsx Show resolved Hide resolved
pkg/github/client/client.go Outdated Show resolved Hide resolved
Copy link
Member

@ivanahuckova ivanahuckova left a comment

Choose a reason for hiding this comment

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

Left couple of comments. The only blocking issue is correctly handling queries when we don't have SelectedAuthType and default to personal-access-token. You could either solve it in func New(ctx context.Context, settings models.Settings) and default to createAccessTokenClient(ctx, settings). Or in func LoadSettings(settings backend.DataSourceInstanceSettings) where you would default to personal-access-token if no selectedAuthType is in settings.JSONData.

pkg/github/client/client.go Show resolved Hide resolved
src/views/ConfigEditor.tsx Outdated Show resolved Hide resolved
src/views/ConfigEditor.tsx Outdated Show resolved Hide resolved
Copy link
Member

@ivanahuckova ivanahuckova 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 a little comment bellow about removing the console.logs.

src/views/ConfigEditor.tsx Outdated Show resolved Hide resolved
@gwdawson gwdawson merged commit 4b811b6 into main Sep 27, 2024
10 checks passed
@gwdawson gwdawson deleted the gareth/app-token-auth branch September 27, 2024 16:09
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.

2 participants