feat(secret-sync): Add Azure Devops PR suggestions

This commit is contained in:
carlosmonastyrski
2025-06-06 10:08:31 -03:00
parent d9bc4da6f1
commit bf72638600
11 changed files with 14 additions and 21 deletions
@@ -70,7 +70,7 @@ const listAzureDevOpsProjects = async (
// Use the standard Azure DevOps Projects API endpoint // Use the standard Azure DevOps Projects API endpoint
// This endpoint returns only projects that the authenticated user has access to // 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 { try {
const { data } = await request.get<TAzureDevOpsProjectsResponse>(devOpsEndpoint, { const { data } = await request.get<TAzureDevOpsProjectsResponse>(devOpsEndpoint, {
headers: getAuthHeaders(appConnection, accessToken) headers: getAuthHeaders(appConnection, accessToken)
@@ -52,11 +52,3 @@ export interface TAzureListRegisteredAppsResponse {
"@odata.nextLink"?: string; "@odata.nextLink"?: string;
value: TAzureRegisteredApp[]; value: TAzureRegisteredApp[];
} }
export interface TAzureDevOps {
keyId: string;
displayName?: string;
startDateTime: string;
endDateTime: string;
secretText?: string;
}
@@ -68,7 +68,7 @@ export const azureDevOpsSyncFactory = ({ kmsService, appConnectionDAL }: TAzureD
environmentName: string, environmentName: string,
isOAuth: boolean 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<AzureDevOpsVariableGroupList>(url, { const response = await request.get<AzureDevOpsVariableGroupList>(url, {
headers: { headers: {
Authorization: getAuthHeader(accessToken, isOAuth) Authorization: getAuthHeader(accessToken, isOAuth)
@@ -103,7 +103,7 @@ Infisical currently supports two methods for connecting to Azure DevOps, which a
<Tab title="Infisical UI"> <Tab title="Infisical UI">
<Steps> <Steps>
<Step title="Fill in Connection Details"> <Step title="Fill in Connection Details">
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) ![Fill in Connection Details](/images/app-connections/azure/devops/fill-in-connection-details-oauth.png)
<Tip> <Tip>
@@ -132,6 +132,6 @@ Infisical currently supports two methods for connecting to Azure DevOps, which a
</Tabs> </Tabs>
</Step> </Step>
<Step title="Connection Created"> <Step title="Connection Created">
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)
</Step> </Step>
</Steps> </Steps>
@@ -5,8 +5,8 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical."
**Prerequisites:** **Prerequisites:**
- Set up and add secrets to [Infisical Cloud](https://app.infisical.com) - Set up and add secrets to [Infisical Cloud](https://app.infisical.com)
- Create an [Azure DevOps Connection](/integrations/app-connections/azure-devops) - Create an [Azure DevOps Connection](/integrations/app-connections/azure-devops)
<Tabs> <Tabs>
<Tab title="Infisical UI"> <Tab title="Infisical UI">
@@ -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. - **Azure DevOps Connection**: The Azure DevOps Connection to authenticate with.
- **Project**: The Azure DevOps project to deploy secrets to. - **Project**: The Azure DevOps project to deploy secrets to.
<p class="height:1px" /> <p class="height:1px"/>
5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**. 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) ![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": { "secretSync": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "my-key-vault-sync", "name": "my-devops-sync",
"description": "an example sync", "description": "an example sync",
"isEnabled": true, "isEnabled": true,
"version": 1, "version": 1,
@@ -114,7 +114,7 @@ description: "Learn how to configure a Azure DevOps Sync for Infisical."
"lastRemovedAt": null, "lastRemovedAt": null,
"syncOptions": { "syncOptions": {
"initialSyncBehavior": "overwrite-destination", "initialSyncBehavior": "overwrite-destination",
"keySchema": "PIPELINE_${key}", "keySchema": "PIPELINE_${secretKey}",
"disableSecretDeletion": true "disableSecretDeletion": true
}, },
"connection": { "connection": {
@@ -7,7 +7,7 @@ import { OnePassSyncFields } from "./1PasswordSyncFields";
import { AwsParameterStoreSyncFields } from "./AwsParameterStoreSyncFields"; import { AwsParameterStoreSyncFields } from "./AwsParameterStoreSyncFields";
import { AwsSecretsManagerSyncFields } from "./AwsSecretsManagerSyncFields"; import { AwsSecretsManagerSyncFields } from "./AwsSecretsManagerSyncFields";
import { AzureAppConfigurationSyncFields } from "./AzureAppConfigurationSyncFields"; import { AzureAppConfigurationSyncFields } from "./AzureAppConfigurationSyncFields";
import { AzureDevOpsSyncFields } from "./AzureDevopsSyncFields"; import { AzureDevOpsSyncFields } from "./AzureDevOpsSyncFields";
import { AzureKeyVaultSyncFields } from "./AzureKeyVaultSyncFields"; import { AzureKeyVaultSyncFields } from "./AzureKeyVaultSyncFields";
import { CamundaSyncFields } from "./CamundaSyncFields"; import { CamundaSyncFields } from "./CamundaSyncFields";
import { DatabricksSyncFields } from "./DatabricksSyncFields"; import { DatabricksSyncFields } from "./DatabricksSyncFields";
@@ -16,7 +16,7 @@ import {
AwsSecretsManagerSyncReviewFields AwsSecretsManagerSyncReviewFields
} from "./AwsSecretsManagerSyncReviewFields"; } from "./AwsSecretsManagerSyncReviewFields";
import { AzureAppConfigurationSyncReviewFields } from "./AzureAppConfigurationSyncReviewFields"; import { AzureAppConfigurationSyncReviewFields } from "./AzureAppConfigurationSyncReviewFields";
import { AzureDevOpsSyncReviewFields } from "./AzureDevopsSyncReviewFields"; import { AzureDevOpsSyncReviewFields } from "./AzureDevOpsSyncReviewFields";
import { AzureKeyVaultSyncReviewFields } from "./AzureKeyVaultSyncReviewFields"; import { AzureKeyVaultSyncReviewFields } from "./AzureKeyVaultSyncReviewFields";
import { CamundaSyncReviewFields } from "./CamundaSyncReviewFields"; import { CamundaSyncReviewFields } from "./CamundaSyncReviewFields";
import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields"; import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields";
@@ -4,7 +4,7 @@ import { OnePassSyncDestinationCol } from "./1PasswordSyncDestinationCol";
import { AwsParameterStoreSyncDestinationCol } from "./AwsParameterStoreSyncDestinationCol"; import { AwsParameterStoreSyncDestinationCol } from "./AwsParameterStoreSyncDestinationCol";
import { AwsSecretsManagerSyncDestinationCol } from "./AwsSecretsManagerSyncDestinationCol"; import { AwsSecretsManagerSyncDestinationCol } from "./AwsSecretsManagerSyncDestinationCol";
import { AzureAppConfigurationDestinationSyncCol } from "./AzureAppConfigurationDestinationSyncCol"; import { AzureAppConfigurationDestinationSyncCol } from "./AzureAppConfigurationDestinationSyncCol";
import { AzureDevOpsSyncDestinationCol } from "./AzureDevopsDestinationCol"; import { AzureDevOpsSyncDestinationCol } from "./AzureDevOpsSyncDestinationCol";
import { AzureKeyVaultDestinationSyncCol } from "./AzureKeyVaultDestinationSyncCol"; import { AzureKeyVaultDestinationSyncCol } from "./AzureKeyVaultDestinationSyncCol";
import { CamundaSyncDestinationCol } from "./CamundaSyncDestinationCol"; import { CamundaSyncDestinationCol } from "./CamundaSyncDestinationCol";
import { DatabricksSyncDestinationCol } from "./DatabricksSyncDestinationCol"; import { DatabricksSyncDestinationCol } from "./DatabricksSyncDestinationCol";
@@ -112,6 +112,7 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
break; break;
case SecretSync.AzureDevOps: case SecretSync.AzureDevOps:
primaryText = destinationConfig.devopsProjectName; primaryText = destinationConfig.devopsProjectName;
secondaryText = destinationConfig.devopsProjectId;
break; break;
default: default:
throw new Error(`Unhandled Destination Col Values ${destination}`); throw new Error(`Unhandled Destination Col Values ${destination}`);
@@ -14,7 +14,7 @@ import { OnePassSyncDestinationSection } from "./1PasswordSyncDestinationSection
import { AwsParameterStoreSyncDestinationSection } from "./AwsParameterStoreSyncDestinationSection"; import { AwsParameterStoreSyncDestinationSection } from "./AwsParameterStoreSyncDestinationSection";
import { AwsSecretsManagerSyncDestinationSection } from "./AwsSecretsManagerSyncDestinationSection"; import { AwsSecretsManagerSyncDestinationSection } from "./AwsSecretsManagerSyncDestinationSection";
import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigurationSyncDestinationSection"; import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigurationSyncDestinationSection";
import { AzureDevOpsSyncDestinationSection } from "./AzureDevopsSyncDestinationSection"; import { AzureDevOpsSyncDestinationSection } from "./AzureDevOpsSyncDestinationSection";
import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection"; import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection";
import { CamundaSyncDestinationSection } from "./CamundaSyncDestinationSection"; import { CamundaSyncDestinationSection } from "./CamundaSyncDestinationSection";
import { DatabricksSyncDestinationSection } from "./DatabricksSyncDestinationSection"; import { DatabricksSyncDestinationSection } from "./DatabricksSyncDestinationSection";