mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 03:26:27 +00:00
feat(secret-sync): minor fixes
This commit is contained in:
@@ -155,6 +155,8 @@ const createGitLabVariable = async ({
|
|||||||
environmentScope: payload.environmentScope,
|
environmentScope: payload.environmentScope,
|
||||||
protected: payload.protected,
|
protected: payload.protected,
|
||||||
masked: payload.masked,
|
masked: payload.masked,
|
||||||
|
// @ts-expect-error type
|
||||||
|
masked_and_hidden: payload.masked_and_hidden,
|
||||||
raw: false
|
raw: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -323,7 +325,12 @@ export const GitLabSyncFns = {
|
|||||||
const existingVariable = currentVariableMap.get(key);
|
const existingVariable = currentVariableMap.get(key);
|
||||||
|
|
||||||
if (existingVariable) {
|
if (existingVariable) {
|
||||||
if (existingVariable.value !== value) {
|
if (
|
||||||
|
existingVariable.value !== value ||
|
||||||
|
existingVariable.environmentScope !== targetEnvironment ||
|
||||||
|
existingVariable.protected !== destinationConfig.shouldProtectSecrets ||
|
||||||
|
existingVariable.masked !== destinationConfig.shouldMaskSecrets
|
||||||
|
) {
|
||||||
await updateGitLabVariable({
|
await updateGitLabVariable({
|
||||||
accessToken,
|
accessToken,
|
||||||
connection,
|
connection,
|
||||||
@@ -369,7 +376,7 @@ export const GitLabSyncFns = {
|
|||||||
try {
|
try {
|
||||||
const shouldDelete =
|
const shouldDelete =
|
||||||
matchesSchema(variable.key, environment?.slug || "", secretSync.syncOptions.keySchema) &&
|
matchesSchema(variable.key, environment?.slug || "", secretSync.syncOptions.keySchema) &&
|
||||||
variable.key in secretMap;
|
!(variable.key in secretMap);
|
||||||
|
|
||||||
if (shouldDelete) {
|
if (shouldDelete) {
|
||||||
await deleteGitLabVariable({
|
await deleteGitLabVariable({
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Infisical supports two methods for connecting to GitLab: **OAuth** and **Access
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
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`.
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|||||||
+7
-3
@@ -8,7 +8,7 @@ export const GitLabSyncReviewFields = () => {
|
|||||||
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.GitLab }>();
|
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.GitLab }>();
|
||||||
const projectName = watch("destinationConfig.projectName");
|
const projectName = watch("destinationConfig.projectName");
|
||||||
const targetEnvironment = watch("destinationConfig.targetEnvironment");
|
const targetEnvironment = watch("destinationConfig.targetEnvironment");
|
||||||
const groupId = watch("destinationConfig.groupId");
|
const groupName = watch("destinationConfig.groupName");
|
||||||
const scope = watch("destinationConfig.scope");
|
const scope = watch("destinationConfig.scope");
|
||||||
const shouldProtectSecrets = watch("destinationConfig.shouldProtectSecrets");
|
const shouldProtectSecrets = watch("destinationConfig.shouldProtectSecrets");
|
||||||
const shouldMaskSecrets = watch("destinationConfig.shouldMaskSecrets");
|
const shouldMaskSecrets = watch("destinationConfig.shouldMaskSecrets");
|
||||||
@@ -17,8 +17,12 @@ export const GitLabSyncReviewFields = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<GenericFieldLabel label="Scope">{scope}</GenericFieldLabel>
|
<GenericFieldLabel label="Scope">{scope}</GenericFieldLabel>
|
||||||
<GenericFieldLabel label="Project Name">{projectName}</GenericFieldLabel>
|
{scope === GitlabSyncScope.Project && (
|
||||||
{groupId && <GenericFieldLabel label="Group ID">{groupId}</GenericFieldLabel>}
|
<GenericFieldLabel label="Project Name">{projectName}</GenericFieldLabel>
|
||||||
|
)}
|
||||||
|
{scope === GitlabSyncScope.Group && (
|
||||||
|
<GenericFieldLabel label="Group Name">{groupName}</GenericFieldLabel>
|
||||||
|
)}
|
||||||
{targetEnvironment && (
|
{targetEnvironment && (
|
||||||
<GenericFieldLabel label="Environment">{targetEnvironment}</GenericFieldLabel>
|
<GenericFieldLabel label="Environment">{targetEnvironment}</GenericFieldLabel>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user