Documentation ¶
Overview ¶
Package storecontext supplies a pluggable implementation of store.DeviceAndAuthContext.
Index ¶
- func New(st *state.State, b Backend) store.DeviceAndAuthContext
- func NewComposed(st *state.State, devb DeviceBackend, srqs DeviceSessionRequestSigner, ...) store.DeviceAndAuthContext
- func StoreID(mod *asserts.Model) string
- type Backend
- type DeviceBackend
- type DeviceSessionRequestParams
- type DeviceSessionRequestSigner
- type ProxyStoreer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(st *state.State, b Backend) store.DeviceAndAuthContext
New returns a store.DeviceAndAuthContext using the given full-featured Backend.
func NewComposed ¶
func NewComposed(st *state.State, devb DeviceBackend, srqs DeviceSessionRequestSigner, pstoer ProxyStoreer) store.DeviceAndAuthContext
NewComposed returns a store.DeviceAndAuthContext using the given backends.
Types ¶
type Backend ¶
type Backend interface { DeviceBackend DeviceSessionRequestSigner ProxyStoreer }
A Backend exposes device information and device identity assertions, signing session requests and proxy store assertion. Methods can return state.ErrNoState if the underlying needed information is not (yet) available. They can also assume the state lock is held.
type DeviceBackend ¶
type DeviceBackend interface { // Device returns current device state. Device() (*auth.DeviceState, error) // SetDevice sets the device details in the state. SetDevice(device *auth.DeviceState) error // Model returns the device model assertion. Model() (*asserts.Model, error) // Serial returns the device serial assertion. Serial() (*asserts.Serial, error) }
A DeviceBackend exposes device information and device identity assertions. Methods can return state.ErrNoState if the underlying needed information is not (yet) available. They can also assume the state lock is held.
type DeviceSessionRequestParams ¶
type DeviceSessionRequestParams = store.DeviceSessionRequestParams