Skip to content
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

Update tests to pass after removing duplicate IdPs from full export #466

Open
wants to merge 1 commit 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
80 changes: 39 additions & 41 deletions src/cli/idp/idp-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,47 +56,45 @@ export default function setup() {
options,
command
);
if (await getTokens()) {
// export by id/name
if (options.idpId) {
verboseMessage(
`Exporting provider "${
options.idpId
}" from realm "${state.getRealm()}"...`
);
const outcome = await exportSocialIdentityProviderToFile(
options.idpId,
options.file,
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// --all -a
else if (options.all) {
verboseMessage('Exporting all providers to a single file...');
const outcome = await exportSocialIdentityProvidersToFile(
options.file,
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// --all-separate -A
else if (options.allSeparate) {
verboseMessage('Exporting all providers to separate files...');
const outcome = await exportSocialIdentityProvidersToFiles(
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// unrecognized combination of options or no options
else {
printMessage(
'Unrecognized combination of options or no options...',
'error'
);
program.help();
process.exitCode = 1;
}
// export by id/name
if (options.idpId && (await getTokens())) {
verboseMessage(
`Exporting provider "${
options.idpId
}" from realm "${state.getRealm()}"...`
);
const outcome = await exportSocialIdentityProviderToFile(
options.idpId,
options.file,
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// --all -a
else if (options.all && (await getTokens())) {
verboseMessage('Exporting all providers to a single file...');
const outcome = await exportSocialIdentityProvidersToFile(
options.file,
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// --all-separate -A
else if (options.allSeparate && (await getTokens())) {
verboseMessage('Exporting all providers to separate files...');
const outcome = await exportSocialIdentityProvidersToFiles(
options.metadata
);
if (!outcome) process.exitCode = 1;
}
// unrecognized combination of options or no options
else {
printMessage(
'Unrecognized combination of options or no options...',
'error'
);
program.help();
process.exitCode = 1;
}
}
// end command logic inside action handler
Expand Down
Loading
Loading