mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 16:26:37 +00:00
mics: added missing github app connection usage
This commit is contained in:
@@ -164,7 +164,8 @@ export const requestWithGitHubGateway = async <T>(
|
|||||||
|
|
||||||
export const getGitHubAppAuthToken = async (
|
export const getGitHubAppAuthToken = async (
|
||||||
appConnection: TGitHubConnection,
|
appConnection: TGitHubConnection,
|
||||||
gatewayService: Pick<TGatewayServiceFactory, "fnGetGatewayClientTlsByGatewayId">
|
gatewayService: Pick<TGatewayServiceFactory, "fnGetGatewayClientTlsByGatewayId">,
|
||||||
|
gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">
|
||||||
) => {
|
) => {
|
||||||
const appCfg = getConfig();
|
const appCfg = getConfig();
|
||||||
const appId = appCfg.INF_APP_CONNECTION_GITHUB_APP_ID;
|
const appId = appCfg.INF_APP_CONNECTION_GITHUB_APP_ID;
|
||||||
@@ -200,6 +201,7 @@ export const getGitHubAppAuthToken = async (
|
|||||||
const response = await requestWithGitHubGateway<{ token: string; expires_at: string }>(
|
const response = await requestWithGitHubGateway<{ token: string; expires_at: string }>(
|
||||||
appConnection,
|
appConnection,
|
||||||
gatewayService,
|
gatewayService,
|
||||||
|
gatewayV2Service,
|
||||||
{
|
{
|
||||||
url: `https://${apiBaseUrl}/app/installations/${installationId}/access_tokens`,
|
url: `https://${apiBaseUrl}/app/installations/${installationId}/access_tokens`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -249,7 +251,7 @@ export const makePaginatedGitHubRequest = async <T, R = T[]>(
|
|||||||
const token =
|
const token =
|
||||||
method === GitHubConnectionMethod.OAuth
|
method === GitHubConnectionMethod.OAuth
|
||||||
? credentials.accessToken
|
? credentials.accessToken
|
||||||
: await getGitHubAppAuthToken(appConnection, gatewayService);
|
: await getGitHubAppAuthToken(appConnection, gatewayService, gatewayV2Service);
|
||||||
|
|
||||||
const baseUrl = `https://${await getGitHubInstanceApiUrl(appConnection)}${path}`;
|
const baseUrl = `https://${await getGitHubInstanceApiUrl(appConnection)}${path}`;
|
||||||
const initialUrlObj = new URL(baseUrl);
|
const initialUrlObj = new URL(baseUrl);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ export const GithubSyncFns = {
|
|||||||
const token =
|
const token =
|
||||||
connection.method === GitHubConnectionMethod.OAuth
|
connection.method === GitHubConnectionMethod.OAuth
|
||||||
? connection.credentials.accessToken
|
? connection.credentials.accessToken
|
||||||
: await getGitHubAppAuthToken(connection, gatewayService);
|
: await getGitHubAppAuthToken(connection, gatewayService, gatewayV2Service);
|
||||||
|
|
||||||
const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
|
const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
|
||||||
const publicKey = await getPublicKey(secretSync, gatewayService, gatewayV2Service, token);
|
const publicKey = await getPublicKey(secretSync, gatewayService, gatewayV2Service, token);
|
||||||
@@ -272,7 +272,7 @@ export const GithubSyncFns = {
|
|||||||
const token =
|
const token =
|
||||||
connection.method === GitHubConnectionMethod.OAuth
|
connection.method === GitHubConnectionMethod.OAuth
|
||||||
? connection.credentials.accessToken
|
? connection.credentials.accessToken
|
||||||
: await getGitHubAppAuthToken(connection, gatewayService);
|
: await getGitHubAppAuthToken(connection, gatewayService, gatewayV2Service);
|
||||||
|
|
||||||
const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
|
const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user