From bf726386007d6ebaf455d1e278a65e80ddfbb4a1 Mon Sep 17 00:00:00 2001 From: carlosmonastyrski Date: Fri, 6 Jun 2025 10:08:31 -0300 Subject: [PATCH] feat(secret-sync): Add Azure Devops PR suggestions --- .../azure-devops/azure-devops-service.ts | 2 +- .../app-connection/azure-devops/azure-devops-types.ts | 8 -------- .../secret-sync/azure-devops/azure-devops-sync-fns.ts | 2 +- docs/integrations/app-connections/azure-devops.mdx | 4 ++-- docs/integrations/secret-syncs/azure-devops.mdx | 10 +++++----- .../SecretSyncDestinationFields.tsx | 2 +- .../SecretSyncReviewFields/SecretSyncReviewFields.tsx | 2 +- ...nationCol.tsx => AzureDevOpsSyncDestinationCol.tsx} | 0 .../SecretSyncDestinationCol.tsx | 2 +- .../SecretSyncsTab/SecretSyncTable/helpers/index.ts | 1 + .../SecretSyncDestinatonSection.tsx | 2 +- 11 files changed, 14 insertions(+), 21 deletions(-) rename frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/{AzureDevopsDestinationCol.tsx => AzureDevOpsSyncDestinationCol.tsx} (100%) diff --git a/backend/src/services/app-connection/azure-devops/azure-devops-service.ts b/backend/src/services/app-connection/azure-devops/azure-devops-service.ts index 4a0705e10..a79a3e7ea 100644 --- a/backend/src/services/app-connection/azure-devops/azure-devops-service.ts +++ b/backend/src/services/app-connection/azure-devops/azure-devops-service.ts @@ -70,7 +70,7 @@ const listAzureDevOpsProjects = async ( // Use the standard Azure DevOps Projects API endpoint // This endpoint returns only projects that the authenticated user has access to - const devOpsEndpoint = `${IntegrationUrls.AZURE_DEVOPS_API_URL}/${orgName}/_apis/projects?api-version=7.1`; + const devOpsEndpoint = `${IntegrationUrls.AZURE_DEVOPS_API_URL}/${encodeURIComponent(orgName)}/_apis/projects?api-version=7.1`; try { const { data } = await request.get(devOpsEndpoint, { headers: getAuthHeaders(appConnection, accessToken) diff --git a/backend/src/services/app-connection/azure-devops/azure-devops-types.ts b/backend/src/services/app-connection/azure-devops/azure-devops-types.ts index 7e8ab8025..62a80c1c5 100644 --- a/backend/src/services/app-connection/azure-devops/azure-devops-types.ts +++ b/backend/src/services/app-connection/azure-devops/azure-devops-types.ts @@ -52,11 +52,3 @@ export interface TAzureListRegisteredAppsResponse { "@odata.nextLink"?: string; value: TAzureRegisteredApp[]; } - -export interface TAzureDevOps { - keyId: string; - displayName?: string; - startDateTime: string; - endDateTime: string; - secretText?: string; -} diff --git a/backend/src/services/secret-sync/azure-devops/azure-devops-sync-fns.ts b/backend/src/services/secret-sync/azure-devops/azure-devops-sync-fns.ts index 84e99857a..3a2921fbd 100644 --- a/backend/src/services/secret-sync/azure-devops/azure-devops-sync-fns.ts +++ b/backend/src/services/secret-sync/azure-devops/azure-devops-sync-fns.ts @@ -68,7 +68,7 @@ export const azureDevOpsSyncFactory = ({ kmsService, appConnectionDAL }: TAzureD environmentName: string, isOAuth: boolean ) => { - const url = `${IntegrationUrls.AZURE_DEVOPS_API_URL}/${orgName}/${projectId}/_apis/distributedtask/variablegroups?api-version=7.1`; + const url = `${IntegrationUrls.AZURE_DEVOPS_API_URL}/${encodeURIComponent(orgName)}/${encodeURIComponent(projectId)}/_apis/distributedtask/variablegroups?api-version=7.1`; const response = await request.get(url, { headers: { Authorization: getAuthHeader(accessToken, isOAuth) diff --git a/docs/integrations/app-connections/azure-devops.mdx b/docs/integrations/app-connections/azure-devops.mdx index 378ab2a4c..1eaa8e82b 100644 --- a/docs/integrations/app-connections/azure-devops.mdx +++ b/docs/integrations/app-connections/azure-devops.mdx @@ -103,7 +103,7 @@ Infisical currently supports two methods for connecting to Azure DevOps, which a - Fill in the **Tenant ID** field with the Directory (Tenant) ID you obtained in the previous step. And the organization name of the Azure DevOps organization you want to connect to. + Fill in the **Tenant ID** field with the Directory (Tenant) ID you obtained in the previous step. Also fill in the organization name of the Azure DevOps organization you want to connect to. ![Fill in Connection Details](/images/app-connections/azure/devops/fill-in-connection-details-oauth.png) @@ -132,6 +132,6 @@ Infisical currently supports two methods for connecting to Azure DevOps, which a - Your **Azure Client Secrets Connection** is now available for use. ![Azure Client Secrets](/images/app-connections/azure/devops/devops-connection.png) + Your **Azure DevOps Connection** is now available for use. ![Azure DevOps](/images/app-connections/azure/devops/devops-connection.png) diff --git a/docs/integrations/secret-syncs/azure-devops.mdx b/docs/integrations/secret-syncs/azure-devops.mdx index 802113484..751c0040f 100644 --- a/docs/integrations/secret-syncs/azure-devops.mdx +++ b/docs/integrations/secret-syncs/azure-devops.mdx @@ -5,8 +5,8 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical." **Prerequisites:** - - Set up and add secrets to [Infisical Cloud](https://app.infisical.com) - - Create an [Azure DevOps Connection](/integrations/app-connections/azure-devops) +- Set up and add secrets to [Infisical Cloud](https://app.infisical.com) +- Create an [Azure DevOps Connection](/integrations/app-connections/azure-devops) @@ -31,7 +31,7 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical." - **Azure DevOps Connection**: The Azure DevOps Connection to authenticate with. - **Project**: The Azure DevOps project to deploy secrets to. -

+

5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**. ![Configure Options](/images/secret-syncs/azure-devops/devops-options.png) @@ -92,7 +92,7 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical." { "secretSync": { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", - "name": "my-key-vault-sync", + "name": "my-devops-sync", "description": "an example sync", "isEnabled": true, "version": 1, @@ -114,7 +114,7 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical." "lastRemovedAt": null, "syncOptions": { "initialSyncBehavior": "overwrite-destination", - "keySchema": "PIPELINE_${key}", + "keySchema": "PIPELINE_${secretKey}", "disableSecretDeletion": true }, "connection": { diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx index 21866c4a6..71405c448 100644 --- a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx +++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx @@ -7,7 +7,7 @@ import { OnePassSyncFields } from "./1PasswordSyncFields"; import { AwsParameterStoreSyncFields } from "./AwsParameterStoreSyncFields"; import { AwsSecretsManagerSyncFields } from "./AwsSecretsManagerSyncFields"; import { AzureAppConfigurationSyncFields } from "./AzureAppConfigurationSyncFields"; -import { AzureDevOpsSyncFields } from "./AzureDevopsSyncFields"; +import { AzureDevOpsSyncFields } from "./AzureDevOpsSyncFields"; import { AzureKeyVaultSyncFields } from "./AzureKeyVaultSyncFields"; import { CamundaSyncFields } from "./CamundaSyncFields"; import { DatabricksSyncFields } from "./DatabricksSyncFields"; diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx index 19988b7e1..854555ffb 100644 --- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx +++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx @@ -16,7 +16,7 @@ import { AwsSecretsManagerSyncReviewFields } from "./AwsSecretsManagerSyncReviewFields"; import { AzureAppConfigurationSyncReviewFields } from "./AzureAppConfigurationSyncReviewFields"; -import { AzureDevOpsSyncReviewFields } from "./AzureDevopsSyncReviewFields"; +import { AzureDevOpsSyncReviewFields } from "./AzureDevOpsSyncReviewFields"; import { AzureKeyVaultSyncReviewFields } from "./AzureKeyVaultSyncReviewFields"; import { CamundaSyncReviewFields } from "./CamundaSyncReviewFields"; import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields"; diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/AzureDevopsDestinationCol.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/AzureDevOpsSyncDestinationCol.tsx similarity index 100% rename from frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/AzureDevopsDestinationCol.tsx rename to frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/AzureDevOpsSyncDestinationCol.tsx diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx index 041d67e73..f342c361c 100644 --- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx +++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx @@ -4,7 +4,7 @@ import { OnePassSyncDestinationCol } from "./1PasswordSyncDestinationCol"; import { AwsParameterStoreSyncDestinationCol } from "./AwsParameterStoreSyncDestinationCol"; import { AwsSecretsManagerSyncDestinationCol } from "./AwsSecretsManagerSyncDestinationCol"; import { AzureAppConfigurationDestinationSyncCol } from "./AzureAppConfigurationDestinationSyncCol"; -import { AzureDevOpsSyncDestinationCol } from "./AzureDevopsDestinationCol"; +import { AzureDevOpsSyncDestinationCol } from "./AzureDevOpsSyncDestinationCol"; import { AzureKeyVaultDestinationSyncCol } from "./AzureKeyVaultDestinationSyncCol"; import { CamundaSyncDestinationCol } from "./CamundaSyncDestinationCol"; import { DatabricksSyncDestinationCol } from "./DatabricksSyncDestinationCol"; diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts index 3ed01a7bb..dea219ee7 100644 --- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts +++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts @@ -112,6 +112,7 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => { break; case SecretSync.AzureDevOps: primaryText = destinationConfig.devopsProjectName; + secondaryText = destinationConfig.devopsProjectId; break; default: throw new Error(`Unhandled Destination Col Values ${destination}`); diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx index 3fdbfd5e9..24cc3908a 100644 --- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx +++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx @@ -14,7 +14,7 @@ import { OnePassSyncDestinationSection } from "./1PasswordSyncDestinationSection import { AwsParameterStoreSyncDestinationSection } from "./AwsParameterStoreSyncDestinationSection"; import { AwsSecretsManagerSyncDestinationSection } from "./AwsSecretsManagerSyncDestinationSection"; import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigurationSyncDestinationSection"; -import { AzureDevOpsSyncDestinationSection } from "./AzureDevopsSyncDestinationSection"; +import { AzureDevOpsSyncDestinationSection } from "./AzureDevOpsSyncDestinationSection"; import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection"; import { CamundaSyncDestinationSection } from "./CamundaSyncDestinationSection"; import { DatabricksSyncDestinationSection } from "./DatabricksSyncDestinationSection";