On 18/11/2013 18:04, Jesse van Bekkum wrote:
Hi
We have connected another IDM system to syncope.
Hi,
I'm curious: which system is this "another IDM"?
When provisioning a user
this system first checks if a user already exists (GET by username) and
then sends a create or update.
When the get on the user fails, syncope returns a 404, but it also writes a
log message on error level. This fills the whole log with stack traces for
a situation that is not really exceptional. This increases the risk that
real errors are missed, and decreases performance. Wouldn't it be better to
write this error to a much lower level, or to not throw an exception at all?
Attempting to read a non-existing user is actually an error; moreover,
the returning HTTP status is consequence of throwing a NotFoundException
from source code (see UserDataBinder#getUserFromId [1]) that is then
catch by syncopeClientError.jsp (Spring MVC) or
RestServiceExceptionMapper (CXF) and transformed into 404.
Or if that is not possible, to add a clean way to check for the existence
of a user?
Oh yes. just search for a user with that username (or id) and check that
the matching list is empty.
HTH
Regards.
[1]
https://svn.apache.org/repos/asf/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/data/UserDataBinder.java
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/