Skip to content

Commit

Permalink
catalog: ensure local authOrigin is always OK, #TASK-5979
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Jun 25, 2024
1 parent f708e18 commit 9e8e940
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ public OpenCGAResult<OrganizationConfiguration> updateConfiguration(String organ
throw new CatalogParameterException("Found duplicated authentication origin id '" + authenticationOrigin.getId()
+ "'.");
}
// Check authOrigin OPENCGA-OPENCGA
if ((authenticationOrigin.getType().equals(AuthenticationOrigin.AuthenticationType.OPENCGA)
&& !CatalogAuthenticationManager.OPENCGA.equals(authenticationOrigin.getId()))
|| (!authenticationOrigin.getType().equals(AuthenticationOrigin.AuthenticationType.OPENCGA)
&& CatalogAuthenticationManager.OPENCGA.equals(authenticationOrigin.getId()))) {
throw new CatalogParameterException("AuthenticationOrigin type '" + AuthenticationOrigin.AuthenticationType.OPENCGA
+ "' must go together with id '" + CatalogAuthenticationManager.OPENCGA + "'.");
}
updateAuthOriginIds.add(authenticationOrigin.getId());
if (i > 0) {
authOriginUpdateBuilder.append(", ");
Expand Down

0 comments on commit 9e8e940

Please sign in to comment.