Skip to content

Commit 8b592cf

Browse files
committed
remove paid members from IAM manageable list
1 parent 64a35e7 commit 8b592cf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/api/routes/iam.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,11 @@ No action is required from you at this time.
597597
entraIdToken,
598598
fastify.environmentConfig.EntraServicePrincipalId,
599599
)
600-
).filter((x) => !genericConfig.ProtectedEntraIDGroups.includes(x.id));
600+
).filter(
601+
(x) =>
602+
!genericConfig.ProtectedEntraIDGroups.includes(x.id) &&
603+
x.id !== fastify.environmentConfig.PaidMemberGroupId,
604+
);
601605
request.log.debug(
602606
"Got manageable groups from Entra ID, setting to cache.",
603607
);

tests/live/iam.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "../../src/common/types/iam.js";
88
import { allAppRoles, AppRoles } from "../../src/common/roles.js";
99
import { getBaseEndpoint } from "./utils.js";
10-
import { genericConfig } from "../../src/common/config.js";
10+
import { environmentConfig, genericConfig } from "../../src/common/config.js";
1111

1212
const baseEndpoint = getBaseEndpoint();
1313
test("getting groups", async () => {
@@ -28,6 +28,9 @@ test("getting groups", async () => {
2828
expect(item["displayName"].length).greaterThan(0);
2929
expect(item["id"].length).greaterThan(0);
3030
expect(genericConfig.ProtectedEntraIDGroups).not.toContain(item["id"]);
31+
expect(genericConfig.ProtectedEntraIDGroups).not.toStrictEqual(
32+
environmentConfig["dev"].PaidMemberGroupId,
33+
);
3134
}
3235
});
3336

0 commit comments

Comments
 (0)