Merged 5.2.0 (5.2.0) to HEAD (5.2)

134066 mward: Merged 5.2.N (5.2.1) to 5.2.0 (5.2.0)
      134044 mward: REPO-1773: Validate ticket API call returns incorrect body with 404 status code


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@134205 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2017-01-11 10:37:23 +00:00
parent 5584458b2f
commit 282a62c418
2 changed files with 10 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ import org.alfresco.rest.api.People;
import org.alfresco.rest.api.model.LoginTicket;
import org.alfresco.rest.api.model.LoginTicketResponse;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.core.exceptions.NotFoundException;
import org.alfresco.rest.framework.core.exceptions.PermissionDeniedException;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.rest.framework.webscripts.WithResponse;
@@ -114,12 +115,12 @@ public class AuthenticationsImpl implements Authentications
// or the user is not fully authenticated
if (currentUser == null || !currentUser.equals(ticketUser))
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
}
catch (AuthenticationException e)
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
LoginTicketResponse response = new LoginTicketResponse();
response.setId(ticket);
@@ -144,7 +145,7 @@ public class AuthenticationsImpl implements Authentications
// or the user is not fully authenticated
if (currentUser == null || !currentUser.equals(ticketUser))
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
else
{
@@ -154,7 +155,7 @@ public class AuthenticationsImpl implements Authentications
}
catch (AuthenticationException e)
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
}