Skip to content

Commit

Permalink
Remove duplicate IDPs from full export
Browse files Browse the repository at this point in the history
  • Loading branch information
phalestrivir committed Dec 10, 2024
1 parent 5860f44 commit abd87e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 764 deletions.
10 changes: 9 additions & 1 deletion src/ops/ConfigOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export async function exportFullConfiguration({
...config.global,
};

//Clean up duplicates
//Clean up global duplicates
if (globalConfig.idm) {
Object.keys(globalConfig.idm)
.filter(
Expand Down Expand Up @@ -613,6 +613,14 @@ export async function exportFullConfiguration({
)?.trustedJwtIssuer,
...config.realm[realm],
};
//Clean up realm duplicates
if (
realmConfig[realm].service &&
realmConfig[realm].service['SocialIdentityProviders']
) {
delete realmConfig[realm].service['SocialIdentityProviders']
.nextDescendents;
}
}
state.setRealm(currentRealm);

Expand Down
2 changes: 1 addition & 1 deletion src/ops/ServiceOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export async function putFullService({
});

// return fast if no next descendents supplied
if (nextDescendents.length === 0) {
if (!nextDescendents || nextDescendents.length === 0) {
debugMessage({
message: `ServiceOps.putFullService: end (w/o descendents)`,
state,
Expand Down
Loading

0 comments on commit abd87e4

Please sign in to comment.