mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix TeamCity integration
This commit is contained in:
@@ -713,11 +713,12 @@ export const getIntegrationAuthNorthflankSecretGroups = async (req: Request, res
|
||||
*/
|
||||
export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: Response) => {
|
||||
const {
|
||||
params: { integrationAuthId, appId }
|
||||
params: { integrationAuthId },
|
||||
query: { appId }
|
||||
} = await validateRequest(reqValidator.GetIntegrationAuthTeamCityBuildConfigsV1, req);
|
||||
|
||||
|
||||
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
||||
const { integrationAuth } = await getIntegrationAuthAccessHelper({
|
||||
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
||||
integrationAuthId: new ObjectId(integrationAuthId)
|
||||
});
|
||||
|
||||
@@ -749,13 +750,13 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res:
|
||||
const {
|
||||
data: { buildType }
|
||||
} = await standardRequest.get<GetTeamCityBuildConfigsRes>(
|
||||
`${req.integrationAuth.url}/app/rest/buildTypes`,
|
||||
`${integrationAuth.url}/app/rest/buildTypes`,
|
||||
{
|
||||
params: {
|
||||
locator: `project:${appId}`
|
||||
},
|
||||
headers: {
|
||||
Authorization: `Bearer ${req.accessToken}`,
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
Accept: "application/json"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ export const getIntegrationAuthAccessHelper = async ({
|
||||
let accessId;
|
||||
let accessToken;
|
||||
const integrationAuth = await IntegrationAuth.findById(integrationAuthId).select(
|
||||
"workspace integration +accessCiphertext +accessIV +accessTag +accessExpiresAt +refreshCiphertext +refreshIV +refreshTag +accessIdCiphertext +accessIdIV +accessIdTag metadata teamId"
|
||||
"workspace integration +accessCiphertext +accessIV +accessTag +accessExpiresAt +refreshCiphertext +refreshIV +refreshTag +accessIdCiphertext +accessIdIV +accessIdTag metadata teamId url"
|
||||
);
|
||||
|
||||
if (!integrationAuth)
|
||||
|
||||
@@ -153,9 +153,11 @@ export const DeleteIntegrationAuthV1 = z.object({
|
||||
});
|
||||
|
||||
export const GetIntegrationAuthTeamCityBuildConfigsV1 = z.object({
|
||||
params:z.object({
|
||||
appId:z.string().trim(),
|
||||
params: z.object({
|
||||
integrationAuthId:z.string().trim()
|
||||
}),
|
||||
query: z.object({
|
||||
appId:z.string().trim()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -197,6 +197,8 @@ const fetchIntegrationAuthTeamCityBuildConfigs = async ({
|
||||
integrationAuthId: string;
|
||||
appId: string;
|
||||
}) => {
|
||||
if (appId === "") return [];
|
||||
|
||||
const {
|
||||
data: { buildConfigs }
|
||||
} = await apiRequest.get<{ buildConfigs: TeamCityBuildConfig[] }>(
|
||||
|
||||
@@ -49,7 +49,7 @@ export default function TeamCityCreateIntegrationPage() {
|
||||
integrationAuthId: (integrationAuthId as string) ?? "",
|
||||
appId: targetAppId
|
||||
});
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (workspace) {
|
||||
setSelectedSourceEnvironment(workspace.environments[0].slug);
|
||||
|
||||
Reference in New Issue
Block a user