Skip to content

Commit 42bac97

Browse files
committed
always expose scim endpoints
1 parent 2c48e39 commit 42bac97

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

packages/services/server/.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ FEEDBACK_SLACK_CHANNEL="#hive"
6060
# Organization level Open ID Connect Authentication
6161
AUTH_ORGANIZATION_OIDC=1
6262
# Organization level SCIM provisioning for users and groups
63-
AUTH_ORGANIZATION_SCIM=1
63+
AUTH_ORGANIZATION_SCIM=0
6464

6565
## Enable GitHub login
6666
AUTH_GITHUB="<sync>"

packages/services/server/src/index.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -659,19 +659,17 @@ export async function main() {
659659
});
660660
}
661661

662-
if (env.organizationSCIM) {
663-
logger.debug('register scim routes');
664-
const scimPlugin = createSCIMPlugin(
665-
authN,
666-
storage.pool,
667-
storage,
668-
registry.injector.get(OIDCIntegrationStore),
669-
registry.injector.get(RedisRateLimiter),
670-
new ClickHouse(env.clickhouse, new HttpClient(), logger),
671-
env.graphql.origin + '/scim/v2',
672-
);
673-
await server.register(scimPlugin, { prefix: '/scim/v2' });
674-
}
662+
const scimPlugin = createSCIMPlugin(
663+
authN,
664+
storage.pool,
665+
storage,
666+
registry.injector.get(OIDCIntegrationStore),
667+
registry.injector.get(RedisRateLimiter),
668+
new ClickHouse(env.clickhouse, new HttpClient(), logger),
669+
env.graphql.origin + '/scim/v2',
670+
env.organizationSCIM,
671+
);
672+
await server.register(scimPlugin, { prefix: '/scim/v2' });
675673

676674
if (env.exposeMemoryUtils) {
677675
logger.debug('exposing memory utils endpoints');

packages/services/server/src/scim.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const createSCIMPlugin =
195195
rateLimiter: RedisRateLimiter,
196196
clickHouse: ClickHouse,
197197
baseUri: string,
198+
isSCIMEnabled: boolean,
198199
): FastifyPluginAsync =>
199200
async server => {
200201
async function authenticateAuthorizeAndResolveOrganizationFromRequest(
@@ -262,7 +263,7 @@ export const createSCIMPlugin =
262263
}),
263264
]);
264265

265-
if (!organization.featureFlags.scim || !oidcIntegration) {
266+
if ((!organization.featureFlags.scim && !isSCIMEnabled) || !oidcIntegration) {
266267
return {
267268
type: 'error' as const,
268269
error: createSCIMError({

0 commit comments

Comments
 (0)