snap download does not allow store viewers to download essential snaps per revision

Bug #1953675 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Fix Released
Medium
Natalia Bidart
snapd
Confirmed
Low
Unassigned

Bug Description

We got a customer report saying that they couldn't access snapd revision 13640 by using a command like this one:

UBUNTU_STORE_ID=brand-store-id UBUNTU_STORE_AUTH_DATA_FILENAME=store-viewer.credentials snap download --revision=13640 snapd

A few months ago, we changed the store ACLs so store viewers could access any previously released revision for any snap available in their store. This change was introduced because when brand store users build their images, they usually need a specific revision of some snaps which is usually the latest revision they have validated, which is in most cases not a currently released one (but certainly was released some time in the past).

This report from the customer showed that we had a bug in our logic, since snapd wasn't allowed to be downloaded. I investigated further and the snap store ACL API endpoint was returning "false" for "allowed_by_revision":

{
    "user_external_id": "usso:https://login.ubuntu.com/+id/openid-suffix",
    "permissions": {
        "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4": {
            "allowed_if_private": false,
            "allowed_by_revision": false
        }
    }
}

Checking deep in our backend code, the checks need to consider essential snaps as part of any store (so far they only check among all the snaps that are showing in a store the user has viewer role in).

Separately, the help for `snap download` should be extended to say that any user with store viewer role can access snaps by revision if the snap is available from their store:

      --revision= Download the given revision of a snap, to which you must have developer access

Changed in snapstore-server:
status: New → Triaged
importance: Undecided → Medium
description: updated
Revision history for this message
Ian Johnson (anonymouse67) wrote :

If the specified account is not a colloborator on the snapd snap why should they be able to download any arbitrary revision of the snapd snap? I think this is by design that they cannot access any arbitrary revision of a snap, even if that snap is included in their brand store.

Changed in snapd:
status: New → Incomplete
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Thanks Ian for commenting. I have reworked the description to be more explicit about what has been already solved, and what this bug is really about, sorry for the confusion.

The part that affects snapd is the help text in the snap download command, it should also say that access by revision is also allowed for store viewers.

description: updated
Changed in snapd:
status: Incomplete → New
Changed in snapstore-server:
assignee: nobody → Natalia Bidart (nataliabidart)
status: Triaged → In Progress
Revision history for this message
Ian Johnson (anonymouse67) wrote :

Ah okay, thanks for clarifying, we should indeed fix up the help text for snap download.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Low
Changed in snapstore-server:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.