Skip to content

Commit 181c898

Browse files
authored
fix: refetch fragment to auto-close dialog (#8359)
1 parent fdcec43 commit 181c898

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

packages/services/api/src/modules/oidc-integrations/providers/oidc-integrations.provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class OIDCIntegrationsProvider {
427427
organizationId: oidcIntegration.linkedOrganizationId,
428428
});
429429

430-
if (!organization.featureFlags.scim) {
430+
if (!organization.featureFlags.scim && !this.oidcIntegrationConfig.isSCIMEnabled) {
431431
return {
432432
type: 'error',
433433
message: 'SCIM provisioning is disabled.',

packages/services/api/src/modules/organization/providers/organization-access-tokens.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
resourceLevelToHumanReadableName,
2525
resourceLevelToResourceLevelType,
2626
} from '../../auth/resolvers/Permission';
27+
import { OIDCIntegrationConfig } from '../../oidc-integrations/providers/oidc-integration-config';
2728
import { OTEL_TRACING_ENABLED } from '../../operations/providers/traces';
2829
import { SCHEMA_PROPOSALS_ENABLED } from '../../proposals/providers/schema-proposals-enabled-token';
2930
import { IdTranslator } from '../../shared/providers/id-translator';
@@ -193,6 +194,7 @@ export class OrganizationAccessTokens {
193194
@Inject(OTEL_TRACING_ENABLED) private otelTracingEnabled: boolean,
194195
@Inject(APP_DEPLOYMENTS_ENABLED) private appDeploymentsEnabled: boolean,
195196
@Inject(SCHEMA_PROPOSALS_ENABLED) private schemaProposalsEnabled: boolean,
197+
private oidcConfig: OIDCIntegrationConfig,
196198
) {
197199
this.logger = logger.child({
198200
source: 'OrganizationAccessTokens',
@@ -996,12 +998,14 @@ export class OrganizationAccessTokens {
996998
const isOTELTracingEnabled = organization.featureFlags.otelTracing || this.otelTracingEnabled;
997999
const isSchemaProposalsEnabled =
9981000
organization.featureFlags.schemaProposals || this.schemaProposalsEnabled;
1001+
const isSCIMProvisioningEnabled =
1002+
organization.featureFlags.scim || this.oidcConfig.isSCIMEnabled;
9991003

10001004
return (id: Permission) =>
10011005
(!isAppDeploymentsEnabled && id.startsWith('appDeployment:')) ||
10021006
(!isOTELTracingEnabled && id.startsWith('traces:')) ||
10031007
(!isSchemaProposalsEnabled && id.startsWith('schemaProposal:')) ||
1004-
(!organization.featureFlags.scim && id.startsWith('scim:provision'))
1008+
(!isSCIMProvisioningEnabled && id.startsWith('scim:provision'))
10051009
? false
10061010
: true;
10071011
}

packages/services/server/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ export async function main() {
570570
broadcastLog,
571571
env.supertokens.secrets,
572572
workloadIdentityFederation,
573+
env.organizationSCIM,
573574
);
574575

575576
if (env.cdn.providers.api !== null) {

packages/services/server/src/supertokens-at-home.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export async function registerSupertokensAtHome(
4949
accessTokenKey: string;
5050
},
5151
workloadIdentityFederation: WorkloadIdentityFederationProvider | null,
52+
isSCIMEnabled: boolean,
5253
) {
5354
const supertokensStore = new SuperTokensStore(storage.pool, server.log);
5455

@@ -1656,7 +1657,10 @@ export async function registerSupertokensAtHome(
16561657
if (!supertokenUser) {
16571658
req.log.debug('no existing user found.');
16581659

1659-
if (organization.featureFlags.scim && oidcIntegration.userProvisioningRequired) {
1660+
if (
1661+
(organization.featureFlags.scim || isSCIMEnabled) &&
1662+
oidcIntegration.userProvisioningRequired
1663+
) {
16601664
req.log.debug('oidc integration settings requires user being provisioned.');
16611665
return rep.status(200).send({
16621666
status: 'SIGN_IN_UP_NOT_ALLOWED',
@@ -1676,7 +1680,7 @@ export async function registerSupertokensAtHome(
16761680
superTokensUserId: supertokenUser.userId,
16771681
});
16781682

1679-
if (organization.featureFlags.scim) {
1683+
if (organization.featureFlags.scim || isSCIMEnabled) {
16801684
if (maybeHiveUser?.provisioningStatus === 'active' && maybeHiveUser.deactivatedAt) {
16811685
req.log.debug('user is deactivated.');
16821686
return rep.status(200).send({
@@ -1702,7 +1706,10 @@ export async function registerSupertokensAtHome(
17021706

17031707
// only perform these updates if the user is not provisioned
17041708
// if the user is provisioned the SCIM provider is the source of truth for all attributes
1705-
if (!organization.featureFlags.scim || !maybeHiveUser?.provisionedByOrganizationId) {
1709+
if (
1710+
(!organization.featureFlags.scim && !isSCIMEnabled) ||
1711+
!maybeHiveUser?.provisionedByOrganizationId
1712+
) {
17061713
if (supertokenUser.email !== email.data) {
17071714
req.log.debug('providers email has changed. Update record.');
17081715
supertokenUser = await supertokensStore.updateOIDCUserEmail({

packages/web/app/src/components/organization/members/list.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ const OrganizationMemberRow_ConfirmSCIMManagementForMember = graphql(`
162162
ok {
163163
confirmedMember {
164164
id
165+
...OrganizationMemberRow_MemberFragment
165166
}
166167
}
167168
error {

0 commit comments

Comments
 (0)