mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 23:27:14 +00:00
Merge pull request #3509 from Infisical/feat/teamcity-ignore-inherited-secrets
feat(secret-sync): TeamCity ignore inherited and non-env values
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
|||||||
TTeamCitySyncWithCredentials
|
TTeamCitySyncWithCredentials
|
||||||
} from "@app/services/secret-sync/teamcity/teamcity-sync-types";
|
} from "@app/services/secret-sync/teamcity/teamcity-sync-types";
|
||||||
|
|
||||||
// Note: Most variables won't be returned with a value due to them being a "password" type (starting with "env.").
|
// Note: Most variables won't be returned with a value due to them being a "password" type.
|
||||||
// TeamCity API returns empty string for password-type variables for security reasons.
|
// TeamCity API returns empty string for password-type variables for security reasons.
|
||||||
const listTeamCityVariables = async ({ instanceUrl, accessToken, project, buildConfig }: TTeamCityListVariables) => {
|
const listTeamCityVariables = async ({ instanceUrl, accessToken, project, buildConfig }: TTeamCityListVariables) => {
|
||||||
const { data } = await request.get<TTeamCityListVariablesResponse>(
|
const { data } = await request.get<TTeamCityListVariablesResponse>(
|
||||||
@@ -25,12 +25,16 @@ const listTeamCityVariables = async ({ instanceUrl, accessToken, project, buildC
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Filters for only non-inherited environment variables
|
||||||
// Strips out "env." from map key, but the "name" field still has the original unaltered key.
|
// Strips out "env." from map key, but the "name" field still has the original unaltered key.
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
data.property.map((variable) => [
|
data.property
|
||||||
variable.name.startsWith("env.") ? variable.name.substring(4) : variable.name,
|
.filter((variable) => !variable.inherited)
|
||||||
{ ...variable, value: variable.value || "" } // Password values will be empty strings from the API for security
|
.filter((variable) => variable.name.startsWith("env."))
|
||||||
])
|
.map((variable) => [
|
||||||
|
variable.name.substring(4),
|
||||||
|
{ ...variable, value: variable.value || "" } // Password values will be empty strings from the API for security
|
||||||
|
])
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ description: "Learn how to configure a TeamCity Sync for Infisical."
|
|||||||
- **Build Configuration**: The build configuration to sync secrets to.
|
- **Build Configuration**: The build configuration to sync secrets to.
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
Not including a Build Configuration will sync secrets to the entire project.
|
Not including a Build Configuration will sync secrets to the project.
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
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**.
|
||||||
@@ -44,6 +44,11 @@ description: "Learn how to configure a TeamCity Sync for Infisical."
|
|||||||
- **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical.
|
- **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical.
|
||||||
- **Import Secrets (Prioritize Infisical)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Infisical over TeamCity when keys conflict.
|
- **Import Secrets (Prioritize Infisical)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Infisical over TeamCity when keys conflict.
|
||||||
- **Import Secrets (Prioritize TeamCity)**: Imports secrets from the destination endpoint before syncing, prioritizing values from TeamCity over Infisical when keys conflict.
|
- **Import Secrets (Prioritize TeamCity)**: Imports secrets from the destination endpoint before syncing, prioritizing values from TeamCity over Infisical when keys conflict.
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Infisical only syncs secrets from within the target scope; inherited secrets will not be imported.
|
||||||
|
</Note>
|
||||||
|
|
||||||
- **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
|
- **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
|
||||||
- **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.
|
- **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user