mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 23:27:14 +00:00
Merge pull request #1016 from Infisical/fix-teamcity
Fix TeamCity integration blank screen issue
This commit is contained in:
@@ -713,11 +713,12 @@ export const getIntegrationAuthNorthflankSecretGroups = async (req: Request, res
|
|||||||
*/
|
*/
|
||||||
export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: Response) => {
|
export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: Response) => {
|
||||||
const {
|
const {
|
||||||
params: { integrationAuthId, appId }
|
params: { integrationAuthId },
|
||||||
|
query: { appId }
|
||||||
} = await validateRequest(reqValidator.GetIntegrationAuthTeamCityBuildConfigsV1, req);
|
} = await validateRequest(reqValidator.GetIntegrationAuthTeamCityBuildConfigsV1, req);
|
||||||
|
|
||||||
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
// 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)
|
integrationAuthId: new ObjectId(integrationAuthId)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -749,13 +750,13 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res:
|
|||||||
const {
|
const {
|
||||||
data: { buildType }
|
data: { buildType }
|
||||||
} = await standardRequest.get<GetTeamCityBuildConfigsRes>(
|
} = await standardRequest.get<GetTeamCityBuildConfigsRes>(
|
||||||
`${req.integrationAuth.url}/app/rest/buildTypes`,
|
`${integrationAuth.url}/app/rest/buildTypes`,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
locator: `project:${appId}`
|
locator: `project:${appId}`
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${req.accessToken}`,
|
Authorization: `Bearer ${accessToken}`,
|
||||||
Accept: "application/json"
|
Accept: "application/json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export const getIntegrationAuthAccessHelper = async ({
|
|||||||
let accessId;
|
let accessId;
|
||||||
let accessToken;
|
let accessToken;
|
||||||
const integrationAuth = await IntegrationAuth.findById(integrationAuthId).select(
|
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)
|
if (!integrationAuth)
|
||||||
|
|||||||
@@ -153,9 +153,11 @@ export const DeleteIntegrationAuthV1 = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const GetIntegrationAuthTeamCityBuildConfigsV1 = z.object({
|
export const GetIntegrationAuthTeamCityBuildConfigsV1 = z.object({
|
||||||
params:z.object({
|
params: z.object({
|
||||||
appId:z.string().trim(),
|
|
||||||
integrationAuthId:z.string().trim()
|
integrationAuthId:z.string().trim()
|
||||||
|
}),
|
||||||
|
query: z.object({
|
||||||
|
appId:z.string().trim()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ const fetchIntegrationAuthTeamCityBuildConfigs = async ({
|
|||||||
integrationAuthId: string;
|
integrationAuthId: string;
|
||||||
appId: string;
|
appId: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
if (appId === "") return [];
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { buildConfigs }
|
data: { buildConfigs }
|
||||||
} = await apiRequest.get<{ buildConfigs: TeamCityBuildConfig[] }>(
|
} = await apiRequest.get<{ buildConfigs: TeamCityBuildConfig[] }>(
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default function TeamCityCreateIntegrationPage() {
|
|||||||
integrationAuthId: (integrationAuthId as string) ?? "",
|
integrationAuthId: (integrationAuthId as string) ?? "",
|
||||||
appId: targetAppId
|
appId: targetAppId
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (workspace) {
|
if (workspace) {
|
||||||
setSelectedSourceEnvironment(workspace.environments[0].slug);
|
setSelectedSourceEnvironment(workspace.environments[0].slug);
|
||||||
|
|||||||
Reference in New Issue
Block a user