Roundup Tracker - Issues

Message6766

Author rouilj
Recipients rouilj, schlatterbeck
Date 2019-10-25.00:09:33
Message-id <1571962173.38.0.865517932038.issue2551051@roundup.psfhosted.org>
In-reply-to
Ralf, just a ping. This is still open to address the lack of error if the
user specifies an invalid transitive property.

I was thinking, should we return some 400 code if a user doesn't have
the ability to search by a property?

IIUC the current code ignores properties that can't be searched.  So
the search returns 200, but the search results are not for the
search that was requested.

Error code 403 says:

  403 Forbidden
    The request contained valid data and was understood by the server,
    but the server is refusing action. This may be due to the user not
    having the necessary permissions for a resource or needing an
    account of some sort, or attempting a prohibited action
    (e.g. creating a duplicate record where only one is allowed). This
    code is also typically used if the request provided authentication
    via the WWW-Authenticate header field, but the server did not
    accept that authentication. The request should not be repeated.

I am focusing on "This may be due to the user not having the necessary
permissions for a resource". The missing permission is search on the
transitive property.

For a user without search perms on messages.author, running:

    /rest/data/issue?messages.author=2

should return a 403 with:

  User does not have search permission on messages.author.

I claim this is a better response. It notifies the client that the
request can't be completed as written. It also allows the client and
the roundup admin to address a possible bug in the schema.

Validating this may also allow addressing the incorrect property
issue. So filtering by the non-existent messages.authors:

    /rest/data/issue?messages.authors=2

gets a 400 response with:

   messages.authors is not a valid property for issue.

Where 400 error is:

  400 Bad Request
    The server cannot or will not process the request due to an
    apparent client error (e.g., malformed request syntax, size too
    large, invalid request message framing, or deceptive request
    routing).  Also if we do this, I claim it should be done for
    non-transitive fields as well. E.G. if i don't have acess to the
    user address property, a request:

the request syntax is malformed due to using an incorrect property
name.

What does the underlying search code do if passed an invalid property
or a property that the user can't access? If they raise different
exceptions for no permission and bad property, the error handling code
can identify the offending property for reporting to the user.

Thoughts?

-- rouilj
History
Date User Action Args
2019-10-25 00:09:33rouiljsetmessageid: <1571962173.38.0.865517932038.issue2551051@roundup.psfhosted.org>
2019-10-25 00:09:33rouiljsetrecipients: + rouilj, schlatterbeck
2019-10-25 00:09:33rouiljlinkissue2551051 messages
2019-10-25 00:09:33rouiljcreate