Skip to content

Commit

Permalink
Bug/Vas-#12843 : fix bug on patch saml provider (#1866)
Browse files Browse the repository at this point in the history
Co-authored-by: Benaissa BENARBIA <benaissa.benarbia.ext@culture.gouv.fr>
  • Loading branch information
bbenaissa and Benaissa BENARBIA authored May 21, 2024
1 parent 85986f0 commit 0a1146b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public ResponseEntity<Void> checkExist(final String criteria) {
throw new UnsupportedOperationException("checkExist not implemented");
}

/**
* In this method, exceptionally, we disable content sanitization because we are dealing with SAML-type providers whose XML configuration file might contain HTML content.
*/
@Override
@PostMapping
@Secured(ServicesData.ROLE_CREATE_PROVIDERS)
Expand All @@ -139,6 +142,9 @@ public IdentityProviderDto update(final @PathVariable("id") String id, final @Va
throw new UnsupportedOperationException("update not implemented");
}

/**
* In this method, exceptionally, we disable content sanitization because we are dealing with SAML-type providers whose XML configuration file might contain HTML content.
*/
@Override
@PatchMapping(CommonConstants.PATH_ID)
@Secured(ServicesData.ROLE_UPDATE_PROVIDERS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public ResponseEntity<Void> checkExist(final String criteria) {
}

/**
* {@inheritDoc}
* In this method, exceptionally, we disable content sanitization because we are dealing with SAML-type providers whose XML configuration file might contain HTML content.
*/
@Override
@PostMapping
Expand All @@ -154,7 +154,7 @@ public IdentityProviderDto update(final @PathVariable("id") String id,
}

/**
* {@inheritDoc}
* In this method, exceptionally, we disable content sanitization because we are dealing with SAML-type providers whose XML configuration file might contain HTML content.
*/
@Override
@PatchMapping(CommonConstants.PATH_ID)
Expand All @@ -164,7 +164,6 @@ public IdentityProviderDto patch(final @PathVariable("id") String id,
LOGGER.debug("Patch {}", id, partialDto);
ParameterChecker.checkParameter("The Identifier is a mandatory parameter: ", id);
SanityChecker.checkSecureParameter(id);
SanityChecker.sanitizeCriteria(partialDto);
Assert.isTrue(StringUtils.equals(id, (String) partialDto.get("id")),
"The DTO identifier must match the path identifier for update.");
return internalIdentityProviderService.patch(partialDto);
Expand Down

0 comments on commit 0a1146b

Please sign in to comment.