Pointing to a brand snap store

Hello all,

Checking the snapd source, I see in https://github.com/snapcore/snapd/blob/master/overlord/auth/auth.go#L424 that the environment variable UBUNTU_STORE_ID has more precedence that the store defined in the model assertion.

On the other hand, the model assertion is used to register the device and obtain a serial which is needed to obtain a device session, which then is used in every request against the store. So if there is a mismatch between these two (the store in the model assertion and the store in the env variable) the device will misbehave.

I think we should have the env variable UBUNTU_STORE_ID only be honoured if there is no model assertion in the device. Can you think of any reason why this could be an issue?

Thanks!

1 Like

no, ignoring the variable if there’s a model seems the step in the right direction (at some point we would really like to remove the variable completely)

1 Like

@natalia here’s a tentative PR that moves toward what you suggested I think:

https://github.com/snapcore/snapd/pull/3382

1 Like

Agreed, we really want to get rid of that eventually, even because the store itself should refuse to get requests for arbitrary stores without proof of relevance.