mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 21:27:10 +00:00
misc: finalized variable names
This commit is contained in:
+3
-3
@@ -37,7 +37,7 @@ CLIENT_ID_VERCEL=
|
|||||||
CLIENT_ID_NETLIFY=
|
CLIENT_ID_NETLIFY=
|
||||||
CLIENT_ID_GITHUB=
|
CLIENT_ID_GITHUB=
|
||||||
CLIENT_ID_GITHUB_APP=
|
CLIENT_ID_GITHUB_APP=
|
||||||
CLIENT_SLUG_GITHUB=
|
CLIENT_SLUG_GITHUB_APP=
|
||||||
CLIENT_ID_GITLAB=
|
CLIENT_ID_GITLAB=
|
||||||
CLIENT_ID_BITBUCKET=
|
CLIENT_ID_BITBUCKET=
|
||||||
CLIENT_SECRET_HEROKU=
|
CLIENT_SECRET_HEROKU=
|
||||||
@@ -49,8 +49,8 @@ CLIENT_SECRET_GITLAB=
|
|||||||
CLIENT_SECRET_BITBUCKET=
|
CLIENT_SECRET_BITBUCKET=
|
||||||
CLIENT_SLUG_VERCEL=
|
CLIENT_SLUG_VERCEL=
|
||||||
|
|
||||||
GITHUB_APP_PRIVATE_KEY=
|
CLIENT_PRIVATE_KEY_GITHUB_APP=
|
||||||
GITHUB_APP_ID=
|
CLIENT_APP_ID_GITHUB_APP=
|
||||||
|
|
||||||
# Sentry (optional) for monitoring errors
|
# Sentry (optional) for monitoring errors
|
||||||
SENTRY_DSN=
|
SENTRY_DSN=
|
||||||
|
|||||||
@@ -120,12 +120,12 @@ const envSchema = z
|
|||||||
// github oauth
|
// github oauth
|
||||||
CLIENT_ID_GITHUB: zpStr(z.string().optional()),
|
CLIENT_ID_GITHUB: zpStr(z.string().optional()),
|
||||||
CLIENT_SECRET_GITHUB: zpStr(z.string().optional()),
|
CLIENT_SECRET_GITHUB: zpStr(z.string().optional()),
|
||||||
CLIENT_SLUG_GITHUB: zpStr(z.string().optional()),
|
CLIENT_SLUG_GITHUB_APP: zpStr(z.string().optional()),
|
||||||
// github app
|
// github app
|
||||||
CLIENT_ID_GITHUB_APP: zpStr(z.string().optional()),
|
CLIENT_ID_GITHUB_APP: zpStr(z.string().optional()),
|
||||||
CLIENT_SECRET_GITHUB_APP: zpStr(z.string().optional()),
|
CLIENT_SECRET_GITHUB_APP: zpStr(z.string().optional()),
|
||||||
GITHUB_APP_PRIVATE_KEY: zpStr(z.string().optional()),
|
CLIENT_PRIVATE_KEY_GITHUB_APP: zpStr(z.string().optional()),
|
||||||
GITHUB_APP_ID: z.coerce.number().optional(),
|
CLIENT_APP_ID_GITHUB_APP: z.coerce.number().optional(),
|
||||||
|
|
||||||
// azure
|
// azure
|
||||||
CLIENT_ID_AZURE: zpStr(z.string().optional()),
|
CLIENT_ID_AZURE: zpStr(z.string().optional()),
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ const getAppsGithub = async ({
|
|||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
authStrategy: createAppAuth,
|
authStrategy: createAppAuth,
|
||||||
auth: {
|
auth: {
|
||||||
appId: appCfg.GITHUB_APP_ID,
|
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
|
||||||
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
|
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
|
||||||
installationId: authMetadata.installationId
|
installationId: authMetadata.installationId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -647,8 +647,8 @@ export const integrationAuthServiceFactory = ({
|
|||||||
octokit = new Octokit({
|
octokit = new Octokit({
|
||||||
authStrategy: createAppAuth,
|
authStrategy: createAppAuth,
|
||||||
auth: {
|
auth: {
|
||||||
appId: appCfg.GITHUB_APP_ID,
|
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
|
||||||
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
|
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
|
||||||
installationId
|
installationId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -724,8 +724,8 @@ export const integrationAuthServiceFactory = ({
|
|||||||
octokit = new Octokit({
|
octokit = new Octokit({
|
||||||
authStrategy: createAppAuth,
|
authStrategy: createAppAuth,
|
||||||
auth: {
|
auth: {
|
||||||
appId: appCfg.GITHUB_APP_ID,
|
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
|
||||||
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
|
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
|
||||||
installationId: authMetadata.installationId
|
installationId: authMetadata.installationId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -183,8 +183,8 @@ export const deleteGithubSecrets = async ({
|
|||||||
octokit = new OctokitWithRetry({
|
octokit = new OctokitWithRetry({
|
||||||
authStrategy: createAppAuth,
|
authStrategy: createAppAuth,
|
||||||
auth: {
|
auth: {
|
||||||
appId: appCfg.GITHUB_APP_ID,
|
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
|
||||||
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
|
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
|
||||||
installationId: authMetadata.installationId
|
installationId: authMetadata.installationId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export const getIntegrationOptions = async () => {
|
|||||||
isAvailable: true,
|
isAvailable: true,
|
||||||
type: "oauth",
|
type: "oauth",
|
||||||
clientId: appCfg.CLIENT_ID_GITHUB,
|
clientId: appCfg.CLIENT_ID_GITHUB,
|
||||||
clientSlug: appCfg.CLIENT_SLUG_GITHUB,
|
clientSlug: appCfg.CLIENT_SLUG_GITHUB_APP,
|
||||||
docsLink: ""
|
docsLink: ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1565,8 +1565,8 @@ const syncSecretsGitHub = async ({
|
|||||||
octokit = new Octokit({
|
octokit = new Octokit({
|
||||||
authStrategy: createAppAuth,
|
authStrategy: createAppAuth,
|
||||||
auth: {
|
auth: {
|
||||||
appId: appCfg.GITHUB_APP_ID,
|
appId: appCfg.CLIENT_APP_ID_GITHUB_APP,
|
||||||
privateKey: appCfg.GITHUB_APP_PRIVATE_KEY,
|
privateKey: appCfg.CLIENT_PRIVATE_KEY_GITHUB_APP,
|
||||||
installationId: authMetadata.installationId
|
installationId: authMetadata.installationId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
|
|||||||
|
|
||||||
if (installationId) {
|
if (installationId) {
|
||||||
// handle app installations
|
// handle app installations
|
||||||
const res = (
|
const oauthRes = (
|
||||||
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
|
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
|
||||||
params: {
|
params: {
|
||||||
client_id: appCfg.CLIENT_ID_GITHUB_APP,
|
client_id: appCfg.CLIENT_ID_GITHUB_APP,
|
||||||
@@ -276,7 +276,7 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
|
|||||||
}>(IntegrationUrls.GITHUB_USER_INSTALLATIONS, {
|
}>(IntegrationUrls.GITHUB_USER_INSTALLATIONS, {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
Authorization: `Bearer ${res.access_token}`,
|
Authorization: `Bearer ${oauthRes.access_token}`,
|
||||||
"Accept-Encoding": "application/json"
|
"Accept-Encoding": "application/json"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -293,14 +293,14 @@ const exchangeCodeGithub = async ({ code, installationId }: { code: string; inst
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accessToken: "",
|
accessToken: "", // for github app integrations, we only need the installationID from the metadata
|
||||||
refreshToken: null,
|
refreshToken: null,
|
||||||
accessExpiresAt: null,
|
accessExpiresAt: null,
|
||||||
installationName: matchingInstallation.account.login
|
installationName: matchingInstallation.account.login
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle normal oauth
|
// handle oauth github integration
|
||||||
const res = (
|
const res = (
|
||||||
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
|
await request.get<ExchangeCodeGithubResponse>(IntegrationUrls.GITHUB_TOKEN_URL, {
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
Reference in New Issue
Block a user