From 5f23c8b9eb2d8379fb9cd9c00ebd5177ef99579a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=B8vring?= Date: Tue, 7 Nov 2023 13:25:05 +0100 Subject: [PATCH] Fixes webhooks attempting to authenticate --- src/composition.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/composition.ts b/src/composition.ts index 916d5814..b54b36b9 100644 --- a/src/composition.ts +++ b/src/composition.ts @@ -63,19 +63,21 @@ const accessTokenService = new LockingAccessTokenService( ) ) -export const gitHubClient = new AccessTokenRefreshingGitHubClient( +export const gitHubClient = new GitHubClient({ + appId: GITHUB_APP_ID, + clientId: GITHUB_CLIENT_ID, + clientSecret: GITHUB_CLIENT_SECRET, + privateKey: gitHubPrivateKey, + accessTokenReader: accessTokenService +}) + +const userGitHubClient = new AccessTokenRefreshingGitHubClient( accessTokenService, - new GitHubClient({ - appId: GITHUB_APP_ID, - clientId: GITHUB_CLIENT_ID, - clientSecret: GITHUB_CLIENT_SECRET, - privateKey: gitHubPrivateKey, - accessTokenReader: accessTokenService - }) + gitHubClient ) export const sessionValidator = new GitHubOrganizationSessionValidator( - gitHubClient, + userGitHubClient, GITHUB_ORGANIZATION_NAME ) @@ -93,7 +95,7 @@ export const projectDataSource = new CachingProjectDataSource( new SessionValidatingProjectDataSource( sessionValidator, new GitHubProjectDataSource( - gitHubClient, + userGitHubClient, GITHUB_ORGANIZATION_NAME ) ),