/v2/find with select=private has different behaviour for queries and name searches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Low
|
Unassigned |
Bug Description
If you do a /v2/find with select=private the behaviour is different when using a query or a name. The name form will return non-private results from the store, but the query only returns results for private snaps.
When using a query only private results are returned, when using a name non-private results are returned. I would have expected only private results to be selected in both cases.
e.g.
$ sudo nc -C -U /run/snapd.socket
GET /v2/find?
Host:
Authorization: Macaroon root="..."
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 25 Jan 2017 00:33:55 GMT
Content-Length: 106
{"type"
$ sudo nc -C -U /run/snapd.socket
GET /v2/find?
Host:
Authorization: Macaroon root="..."
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 25 Jan 2017 00:34:29 GMT
Content-Length: 1221
{"type"
Changed in snappy: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
affects: | snappy → snapd |
Actually, now I read the docs more closely:
'private: search private snaps (by default, find only searches public snaps). Can't be used with name, only q (for now at least)."
So I think this should be returning an error when this is attempted.