store, o/storecontext, o/devicestate, o/c/configcore: use store.access to disable access to snap store (#13198)
* o/c/configcore: add store.access configurable to allow store access to be disable
* o/devicestate: expose store.access via the storeContextBackend
* overlord,o/storecontext: expose store.access via storecontext.storeContext
* store: use store.access to disable access to snap store when using methods store.Store
* configcore: add tests for validation of store.access
* store: test offline store functionality
* o/storecontext: add test case for StoreAccess
* store, o/c/configcore, o/storecontext: remove usage of online as valid value for store.access
* store: correct ErrStoreOffline message
* store: add unit test to check that http retries do not happen when store is offline
* store: rename isStoreOnline to checkStoreOnline for consistency
* store: remove outdated comment
* o/c/configcore: convert handleStoreAccess to be a fsOnlyHandler since it does not need state
* store: disable more instances of store network access
* overlord,o/storecontext: combine ProxyStoreer and StoreAccessQuerier into one interface
* o/devicestate: add test for storeContextBackend.StoreAccess
* store: modify Store.endpointURL to check if the store is offline
* o/storecontext: simplify TestStoreAccess test case
* store: make Store.assertionsEndpointURL return an error if the store is offline
* store: add more test cases for an offline store
* o/devicestate: remove outdated comment
* store: remove outdated comment
* store: fix outdated comments
* store: test that SnapAction returns an error when the store is offline
* store: clarify ErrStoreOffline message
* o/c/configcore: move store.access registration for more general use
* o/c/configcore, dirs: write config file for snap-repair in store.access handler
* cmd/snap-repair: consume snap repair config file to check if store access is offline
* overlord: remove accidental goimports change
* image: set root dir to temp dir for tests
* o/c/configcore: remove build flags from store.go
* store: rename checkStoreOnline to checkStoreOffline for consistency
* Revert "store: rename checkStoreOnline to checkStoreOffline for consistency"
This reverts commit dd07e487127964c417eeac11d1d954a5d1132469.
* cmd/snap-repair, o/c/configcore: use unexported repairConfig for configuring snap-repair
* o/c/configcore: fix broken test following type rename
* o/c/configcore: remove defined error to make future modifications less error-prone
* o/c/configcore: remove superfluous $
* store, o/devicestate, o/storecontext: change StoreAccess methods to StoreOffline methods that return a boolean indicator
* dirs, o/c/configcore: make sure to check fsOnlyContext for a different root dir
* cmd/snap-repair: move this change into a seperate PR
* o/c/configcore: fixup some comments
Co-authored-by: Miguel Pires <email address hidden>
* o/c/configcore: add test for setting store.access on filesystem only apply
---------
Co-authored-by: Miguel Pires <email address hidden>