mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 12:28:54 +00:00
remove debug logs, update comments, other nitpicks
This commit is contained in:
@@ -21,7 +21,7 @@ export const registerTeamCityConnectionRouter = async (server: FastifyZodProvide
|
|||||||
updateSchema: UpdateTeamCityConnectionSchema
|
updateSchema: UpdateTeamCityConnectionSchema
|
||||||
});
|
});
|
||||||
|
|
||||||
// The below endpoints are not exposed and for Infisical App use
|
// The following endpoints are for internal Infisical App use only and not part of the public API
|
||||||
server.route({
|
server.route({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: `/:connectionId/projects`,
|
url: `/:connectionId/projects`,
|
||||||
@@ -51,12 +51,9 @@ export const registerTeamCityConnectionRouter = async (server: FastifyZodProvide
|
|||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
console.log("HIT1");
|
|
||||||
const { connectionId } = req.params;
|
const { connectionId } = req.params;
|
||||||
const projects = await server.services.appConnection.teamcity.listProjects(connectionId, req.permission);
|
const projects = await server.services.appConnection.teamcity.listProjects(connectionId, req.permission);
|
||||||
|
|
||||||
console.log(projects);
|
|
||||||
|
|
||||||
return projects;
|
return projects;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
} 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 (starting with "env.").
|
||||||
|
// 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>(
|
||||||
buildConfig
|
buildConfig
|
||||||
@@ -28,7 +29,7 @@ const listTeamCityVariables = async ({ instanceUrl, accessToken, project, buildC
|
|||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
data.property.map((variable) => [
|
data.property.map((variable) => [
|
||||||
variable.name.startsWith("env.") ? variable.name.substring(4) : variable.name,
|
variable.name.startsWith("env.") ? variable.name.substring(4) : variable.name,
|
||||||
{ ...variable, value: variable.value || "" } // This will almost always be empty string
|
{ ...variable, value: variable.value || "" } // Password values will be empty strings from the API for security
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -72,7 +73,7 @@ const deleteTeamCityVariable = async ({
|
|||||||
return request.delete(
|
return request.delete(
|
||||||
buildConfig
|
buildConfig
|
||||||
? `${instanceUrl}/app/rest/buildTypes/${buildConfig}/parameters/${key}`
|
? `${instanceUrl}/app/rest/buildTypes/${buildConfig}/parameters/${key}`
|
||||||
: `${instanceUrl}/app/rest/projects/${project}/parameters/${key}`,
|
: `${instanceUrl}/app/rest/projects/id:${project}/parameters/${key}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${accessToken}`
|
Authorization: `Bearer ${accessToken}`
|
||||||
@@ -162,7 +163,7 @@ export const TeamCitySyncFns = {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new SecretSyncError({
|
throw new SecretSyncError({
|
||||||
error,
|
error,
|
||||||
secretKey: variable.name
|
secretKey: key
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Infisical supports connecting to TeamCity using an Access Token to securely sync
|
|||||||
You should now see your newly created token in the list of access tokens.
|
You should now see your newly created token in the list of access tokens.
|
||||||

|

|
||||||
</Step>
|
</Step>
|
||||||
<Step title="Setup Vercel Connection in Infisical">
|
<Step title="Setup TeamCity Connection in Infisical">
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tab title="Infisical UI">
|
<Tab title="Infisical UI">
|
||||||
1. Navigate to App Connections
|
1. Navigate to App Connections
|
||||||
|
|||||||
+1
@@ -105,6 +105,7 @@ export const TeamCitySyncFields = () => {
|
|||||||
onChange(selectedOption?.id ?? "");
|
onChange(selectedOption?.id ?? "");
|
||||||
}}
|
}}
|
||||||
options={buildTypes}
|
options={buildTypes}
|
||||||
|
isClearable={true}
|
||||||
placeholder="Select a build configuration..."
|
placeholder="Select a build configuration..."
|
||||||
getOptionLabel={(option) => option.name}
|
getOptionLabel={(option) => option.name}
|
||||||
getOptionValue={(option) => option.id}
|
getOptionValue={(option) => option.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user