misc: finalized variable names

This commit is contained in:
Sheen Capadngan
2024-10-15 18:17:57 +08:00
parent bdae136bed
commit 94b799e80b
8 changed files with 21 additions and 21 deletions
@@ -257,8 +257,8 @@ const getAppsGithub = async ({
const octokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: appCfg.GITHUB_APP_ID,
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
installationId: authMetadata.installationId
}
});
@@ -647,8 +647,8 @@ export const integrationAuthServiceFactory = ({
octokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: appCfg.GITHUB_APP_ID,
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
installationId
}
});
@@ -724,8 +724,8 @@ export const integrationAuthServiceFactory = ({
octokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: appCfg.GITHUB_APP_ID,
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
installationId: authMetadata.installationId
}
});
@@ -183,8 +183,8 @@ export const deleteGithubSecrets = async ({
octokit = new OctokitWithRetry({
authStrategy: createAppAuth,
auth: {
appId: appCfg.GITHUB_APP_ID,
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
installationId: authMetadata.installationId
}
});
@@ -140,7 +140,7 @@ export const getIntegrationOptions = async () => {
isAvailable: true,
type: "oauth",
clientId: appCfg.CLIENT_ID_GITHUB,
clientSlug: appCfg.CLIENT_SLUG_GITHUB,
clientSlug: appCfg.CLIENT_SLUG_GITHUB_APP,
docsLink: ""
},
{
@@ -1565,8 +1565,8 @@ const syncSecretsGitHub = async ({
octokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: appCfg.GITHUB_APP_ID,
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
installationId: authMetadata.installationId
}
});
@@ -249,7 +249,7 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
if (installationId) {
// handle app installations
const res = (
const oauthRes = (
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
params: {
client_id: appCfg.CLIENT_ID_GITHUB_APP,
@@ -276,7 +276,7 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
}>(IntegrationUrls.GITHUB_USER_INSTALLATIONS, {
headers: {
Accept: "application/json",
Authorization: `Bearer ${res.access_token}`,
Authorization: `Bearer ${oauthRes.access_token}`,
"Accept-Encoding": "application/json"
}
})
@@ -293,14 +293,14 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
}
return {
accessToken: "",
accessToken: "", // for github app integrations, we only need the installationID from the metadata
refreshToken: null,
accessExpiresAt: null,
installationName: matchingInstallation.account.login
};
}
// handle normal oauth
// handle oauth github integration
const res = (
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
params: {