nextcloud / lookup-server

:eyes: Lookup server to find remote users for federated sharing
23 stars 16 forks source link

Wrong return code when $signatureHandler->verify returns false #72

Closed pmarini-nc closed 2 years ago

pmarini-nc commented 2 years ago

I'm testing a freshly installed Lookup Server, with hostname gs-lookup.localenv.com, with one of the suggested POST requests to create a user (create-user.json is this sample json):


curl -i -X POST   http://gs-lookup.localenv.com/index.php/users   -H 'Content-Type: application/json' -d '@create-user.json'
HTTP/1.1 200 OK
Date: Fri, 05 Nov 2021 14:57:39 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Length: 0
Content-Type: text/html; charset=UTF-8

Return code is 200, so everything should be ok. However no users are created, e.g. no user is created in table users.

If we have a look at the code in UserManager.php, the logic is that $signatureHandler->verify should return true for the insert in database operation to be called.

I think that the return code if $signatureHandler->verify returns false should not be 200.


Maybe @schiessle, you can have a look?