Skip to content

syn2mas: Allow skipping guest users #4358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tools/syn2mas/src/migrate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface MigrationOptions {
synapseConfigFile: string;
masConfigFile: string;
upstreamProviderMapping: string[];
skipGuests?: boolean;
dryRun?: boolean;
help?: boolean;
}
Expand Down Expand Up @@ -79,6 +80,13 @@ export async function migrate(): Promise<void> {
description:
"Mapping of upstream provider IDs to MAS provider IDs. Format: <upstream_provider_id>:<mas_provider_id>",
},
skipGuests: {
type: Boolean,
optional: true,
defaultValue: false,
description:
"Skip and print warnings for any guests users found in Synapse, instead of aborting",
},
dryRun: {
type: Boolean,
optional: true,
Expand Down Expand Up @@ -201,7 +209,11 @@ export async function migrate(): Promise<void> {
const executions: Execution[] = [];

if (user.is_guest === 1) {
fatal(`Migration of guest users is not supported: ${user.name}`);
if (args.skipGuests) {
log.warn(`Skipping guest user ${user.name}`);
} else {
fatal(`Migration of guest users is not supported: ${user.name}`);
}
}

// users => users
Expand Down
2 changes: 0 additions & 2 deletions tools/syn2mas/src/types/MUser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.

import type { MUserEmail } from "./MUserEmail";

import type { UUID } from "./index";

export interface MUser {
Expand Down
Loading