add secret groups field functionality

This commit is contained in:
Chukwunonso Frank
2023-07-17 22:00:48 +01:00
parent 112d4ec9c0
commit 6ee7081640
3 changed files with 64 additions and 0 deletions
+26
View File
@@ -754,9 +754,35 @@ const getAppsNorthflank = async ({ accessToken }: { accessToken: string }) => {
return {
name: a.name,
appId: a.id,
secretGroups: []
};
});
for (let i = 0; i < apps.length; i++) {
const appName = apps[i].name;
const {
data: {
data: {
secrets
}
}
} = await standardRequest.get(
`${INTEGRATION_NORTHFLANK_API_URL}/v1/projects/${appName}/secrets`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
"Accept-Encoding": "application/json",
},
}
);
const secretGroups = secrets.map((a: any) => {
return a.id
});
apps[i].secretGroups = secretGroups
}
return apps;
};