diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts index 376b03005..2b7a3a733 100644 --- a/backend/src/lib/config/env.ts +++ b/backend/src/lib/config/env.ts @@ -120,12 +120,12 @@ const envSchema = z // github oauth CLIENT_ID_GITHUB: zpStr(z.string().optional()), CLIENT_SECRET_GITHUB: zpStr(z.string().optional()), - CLIENT_SLUG_GITHUB_APP: zpStr(z.string().optional()), // github app CLIENT_ID_GITHUB_APP: zpStr(z.string().optional()), CLIENT_SECRET_GITHUB_APP: zpStr(z.string().optional()), CLIENT_PRIVATE_KEY_GITHUB_APP: zpStr(z.string().optional()), CLIENT_APP_ID_GITHUB_APP: z.coerce.number().optional(), + CLIENT_SLUG_GITHUB_APP: zpStr(z.string().optional()), // azure CLIENT_ID_AZURE: zpStr(z.string().optional()), diff --git a/backend/src/services/integration-auth/integration-auth-service.ts b/backend/src/services/integration-auth/integration-auth-service.ts index bcfe2c773..728e417cf 100644 --- a/backend/src/services/integration-auth/integration-auth-service.ts +++ b/backend/src/services/integration-auth/integration-auth-service.ts @@ -18,7 +18,7 @@ import { KmsDataKey } from "../kms/kms-types"; import { TProjectBotServiceFactory } from "../project-bot/project-bot-service"; import { getApps } from "./integration-app-list"; import { TIntegrationAuthDALFactory } from "./integration-auth-dal"; -import { IntegrationAuthMetadataSchema } from "./integration-auth-schema"; +import { IntegrationAuthMetadataSchema, TIntegrationAuthMetadata } from "./integration-auth-schema"; import { TBitbucketWorkspace, TChecklyGroups, @@ -642,7 +642,7 @@ export const integrationAuthServiceFactory = ({ const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId); let octokit: Octokit; - const { installationId } = (integrationAuth.metadata as { installationId: string }) || {}; + const { installationId } = (integrationAuth.metadata as TIntegrationAuthMetadata) || {}; if (installationId) { octokit = new Octokit({ authStrategy: createAppAuth, diff --git a/docs/images/integrations/github/app/self-hosted-github-app-repository.png b/docs/images/integrations/github/app/self-hosted-github-app-repository.png index 6f9edc56e..edf1d1087 100644 Binary files a/docs/images/integrations/github/app/self-hosted-github-app-repository.png and b/docs/images/integrations/github/app/self-hosted-github-app-repository.png differ diff --git a/docs/integrations/cicd/githubactions.mdx b/docs/integrations/cicd/githubactions.mdx index 899dc6ef5..8f009716c 100644 --- a/docs/integrations/cicd/githubactions.mdx +++ b/docs/integrations/cicd/githubactions.mdx @@ -4,31 +4,31 @@ description: "How to sync secrets from Infisical to GitHub Actions" --- - Alternatively, you can use Infisical's official Github Action + Alternatively, you can use Infisical's official GitHub Action [here](https://github.com/Infisical/secrets-action). Infisical lets you sync secrets to GitHub at the organization-level, repository-level, and repository environment-level. -## Connecting with Github App (Recommended) +## Connecting with GitHub App (Recommended) - + Navigate to your project's integrations tab in Infisical and press on the GitHub tile. ![integrations](../../images/integrations/github/app/integration-overview.png) - Select Github App as the authentication method and click **Connect to Github**. + Select GitHub App as the authentication method and click **Connect to GitHub**. ![integrations github app auth selection](../../images/integrations/github/app/github-app-method-selection.png) - You will then be redirected to the Github app installation page. + You will then be redirected to the GitHub app installation page. ![integrations github app installation](../../images/integrations/github/app/github-app-installation.png) - Install and authorize the Github application. This will redirect you back to the Infisical integration page. + Install and authorize the GitHub application. This will redirect you back to the Infisical integration page. @@ -41,7 +41,7 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- ![integrations github](../../images/integrations/github/integrations-github-scope-org.png) - When using the organization scope, your secrets will be saved in the top-level of your Github Organization. + When using the organization scope, your secrets will be saved in the top-level of your GitHub Organization. You can choose the visibility, which defines which repositories can access the secrets. The options are: - **All public repositories**: All public repositories in the organization can access the secrets. @@ -65,7 +65,7 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- and registering your instance with it. - Navigate to the Github app settings [here](https://github.com/settings/apps). Click **New Github App**. + Navigate to the GitHub app settings [here](https://github.com/settings/apps). Click **New GitHub App**. ![integrations github app create](../../images/integrations/github/app/self-hosted-github-app-create.png) @@ -79,7 +79,7 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- Disable webhook by unchecking the Active checkbox. ![integrations github app webhook](../../images/integrations/github/app/self-hosted-github-app-webhook.png) - Set the repository permissions as follows: Metadata: Read-only, Secrets: Read and write. + Set the repository permissions as follows: Metadata: Read-only, Secrets: Read and write, Environments: Read and write. ![integrations github app repository](../../images/integrations/github/app/self-hosted-github-app-repository.png) Similarly, set the organization permissions as follows: Secrets: Read and write. @@ -90,7 +90,7 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- If you have a GitHub organization, you can create an application under it - in your organization Settings > Developer settings > Github Apps > New Github App. + in your organization Settings > Developer settings > GitHub Apps > New GitHub App. @@ -107,9 +107,9 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- - `CLIENT_ID_GITHUB_APP`: The **Client ID** of your GitHub application. - `CLIENT_SECRET_GITHUB_APP`: The **Client Secret** of your GitHub application. - - `CLIENT_SLUG_GITHUB_APP`: The **Slug** of your Github application. This is the one found in the URL. - - `CLIENT_APP_ID_GITHUB_APP`: The **App ID** of your Github application. - - `CLIENT_PRIVATE_KEY_GITHUB_APP`: The **Private Key** of your Github application. + - `CLIENT_SLUG_GITHUB_APP`: The **Slug** of your GitHub application. This is the one found in the URL. + - `CLIENT_APP_ID_GITHUB_APP`: The **App ID** of your GitHub application. + - `CLIENT_PRIVATE_KEY_GITHUB_APP`: The **Private Key** of your GitHub application. Once added, restart your Infisical instance and use the GitHub integration via app authentication. @@ -118,7 +118,7 @@ Infisical lets you sync secrets to GitHub at the organization-level, repository- -## Connecting with Github OAuth +## Connecting with GitHub OAuth Prerequisites: @@ -129,10 +129,10 @@ Prerequisites: - Navigate to your project's integrations tab in Infisical and press on the Github tile. + Navigate to your project's integrations tab in Infisical and press on the GitHub tile. ![integrations](../../images/integrations/github/integration-overview.png) - Select OAuth as the authentication method and click **Connect to Github**. + Select OAuth as the authentication method and click **Connect to GitHub**. ![integrations github oauth auth selection](../../images/integrations/github/github-oauth-method-selection.png) Grant Infisical access to your GitHub account (organization and repo privileges). @@ -149,7 +149,7 @@ Prerequisites: ![integrations github](../../images/integrations/github/integrations-github-scope-org.png) - When using the organization scope, your secrets will be saved in the top-level of your Github Organization. + When using the organization scope, your secrets will be saved in the top-level of your GitHub Organization. You can choose the visibility, which defines which repositories can access the secrets. The options are: - **All public repositories**: All public repositories in the organization can access the secrets. diff --git a/frontend/src/pages/integrations/github/auth-mode-selection.tsx b/frontend/src/pages/integrations/github/auth-mode-selection.tsx index 514e48b4c..5fcb4f0dd 100644 --- a/frontend/src/pages/integrations/github/auth-mode-selection.tsx +++ b/frontend/src/pages/integrations/github/auth-mode-selection.tsx @@ -33,7 +33,7 @@ export default function GithubIntegrationAuthModeSelectionPage() { return (
- Select Github Integration Auth + Select GitHub Integration Auth @@ -50,7 +50,7 @@ export default function GithubIntegrationAuthModeSelectionPage() { alt="Github logo" />
- Github Integration + GitHub Integration
@@ -74,7 +74,7 @@ export default function GithubIntegrationAuthModeSelectionPage() { }} className="w-full border border-mineshaft-500" > - Github App (Recommended) + GitHub App (Recommended) OAuth @@ -96,7 +96,7 @@ export default function GithubIntegrationAuthModeSelectionPage() { variant="outline_bg" className="mt-4 ml-auto w-min" > - Connect to Github + Connect to GitHub
diff --git a/frontend/src/pages/integrations/select-integration-auth.tsx b/frontend/src/pages/integrations/select-integration-auth.tsx index 3c71ad0b3..42d0ff11f 100644 --- a/frontend/src/pages/integrations/select-integration-auth.tsx +++ b/frontend/src/pages/integrations/select-integration-auth.tsx @@ -137,7 +137,7 @@ export default function SelectIntegrationAuthPage() {
@@ -157,8 +157,7 @@ export default function SelectIntegrationAuthPage() { return (