You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by GitBox <gi...@apache.org> on 2022/10/12 11:17:01 UTC

[GitHub] [syncope] mmoayyed commented on a diff in pull request #381: SYNCOPE-1699: Extract key from path if undefined in request body

mmoayyed commented on code in PR #381:
URL: https://github.com/apache/syncope/pull/381#discussion_r993324192


##########
core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractService.java:
##########
@@ -61,8 +61,23 @@ public abstract class AbstractService implements JAXRSService {
 
     protected String getActualKey(final AnyDAO<?> dao, final String pretendingKey) {
         String actualKey = pretendingKey;
-        if (!SyncopeConstants.UUID_PATTERN.matcher(pretendingKey).matches()) {
-            actualKey = dao.findKey(pretendingKey);
+        if (uriInfo.getPathParameters(true).containsKey("key")) {

Review Comment:
   You would, if the path parameter has a key that does not match the supplied key in the request body. You could in theory be passing one key in the URL, and use another key in the body. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@syncope.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org