diff --git a/backend/src/services/secret-sync/gitlab/gitlab-sync-fns.ts b/backend/src/services/secret-sync/gitlab/gitlab-sync-fns.ts index 37a6d7cf7..0642f368b 100644 --- a/backend/src/services/secret-sync/gitlab/gitlab-sync-fns.ts +++ b/backend/src/services/secret-sync/gitlab/gitlab-sync-fns.ts @@ -155,6 +155,8 @@ const createGitLabVariable = async ({ environmentScope: payload.environmentScope, protected: payload.protected, masked: payload.masked, + // @ts-expect-error type + masked_and_hidden: payload.masked_and_hidden, raw: false }); } @@ -323,7 +325,12 @@ export const GitLabSyncFns = { const existingVariable = currentVariableMap.get(key); if (existingVariable) { - if (existingVariable.value !== value) { + if ( + existingVariable.value !== value || + existingVariable.environmentScope !== targetEnvironment || + existingVariable.protected !== destinationConfig.shouldProtectSecrets || + existingVariable.masked !== destinationConfig.shouldMaskSecrets + ) { await updateGitLabVariable({ accessToken, connection, @@ -369,7 +376,7 @@ export const GitLabSyncFns = { try { const shouldDelete = matchesSchema(variable.key, environment?.slug || "", secretSync.syncOptions.keySchema) && - variable.key in secretMap; + !(variable.key in secretMap); if (shouldDelete) { await deleteGitLabVariable({ diff --git a/docs/integrations/app-connections/gitlab.mdx b/docs/integrations/app-connections/gitlab.mdx index 62728882e..308dae703 100644 --- a/docs/integrations/app-connections/gitlab.mdx +++ b/docs/integrations/app-connections/gitlab.mdx @@ -24,7 +24,7 @@ Infisical supports two methods for connecting to GitLab: **OAuth** and **Access ![GitLab Applications Settings](/images/app-connections/gitlab/gitlab-applications.png) - Create the application. As part of the form, set the **Redirect URI** to `https://your-domain.com/integrations/gitlab/oauth2/callback`. + Create the application. As part of the form, set the **Redirect URI** to `https://your-domain.com/organization/app-connections/gitlab/oauth/callback`. ![GitLab New Application Form](/images/app-connections/gitlab/gitlab-create-application-top.png) ![GitLab New Application Form](/images/app-connections/gitlab/gitlab-create-application-bottom.png) diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/GitLabSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/GitLabSyncReviewFields.tsx index e1fb32d08..b9f62ebcc 100644 --- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/GitLabSyncReviewFields.tsx +++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/GitLabSyncReviewFields.tsx @@ -8,7 +8,7 @@ export const GitLabSyncReviewFields = () => { const { watch } = useFormContext(); const projectName = watch("destinationConfig.projectName"); const targetEnvironment = watch("destinationConfig.targetEnvironment"); - const groupId = watch("destinationConfig.groupId"); + const groupName = watch("destinationConfig.groupName"); const scope = watch("destinationConfig.scope"); const shouldProtectSecrets = watch("destinationConfig.shouldProtectSecrets"); const shouldMaskSecrets = watch("destinationConfig.shouldMaskSecrets"); @@ -17,8 +17,12 @@ export const GitLabSyncReviewFields = () => { return ( <> {scope} - {projectName} - {groupId && {groupId}} + {scope === GitlabSyncScope.Project && ( + {projectName} + )} + {scope === GitlabSyncScope.Group && ( + {groupName} + )} {targetEnvironment && ( {targetEnvironment} )}