Skip to content

Commit 3476631

Browse files
committed
filter on protected groups
1 parent 0583ea6 commit 3476631

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/api/routes/iam.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,13 @@ No action is required from you at this time.
591591
request.log.debug("Got manageable groups from Redis cache.");
592592
return reply.status(200).send(redisResponse);
593593
}
594-
const freshData = await getServicePrincipalOwnedGroups(
595-
entraIdToken,
596-
fastify.environmentConfig.EntraServicePrincipalId,
597-
);
594+
// get groups, but don't show protected groups as manageable
595+
const freshData = (
596+
await getServicePrincipalOwnedGroups(
597+
entraIdToken,
598+
fastify.environmentConfig.EntraServicePrincipalId,
599+
)
600+
).filter((x) => !genericConfig.ProtectedEntraIDGroups.includes(x.id));
598601
request.log.debug(
599602
"Got manageable groups from Entra ID, setting to cache.",
600603
);

0 commit comments

Comments
 (0)