storecontext

package
v0.0.0-...-c7fba9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storecontext supplies a pluggable implementation of store.DeviceAndAuthContext.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns a store.DeviceAndAuthContext using the given full-featured Backend.

func NewComposed

NewComposed returns a store.DeviceAndAuthContext using the given backends.

func StoreID

func StoreID(mod *asserts.Model) string

StoreID returns the store set in the model assertion, if mod != nil and it's not the generic classic model, or the override from the UBUNTU_STORE_ID envvar.

Types

type Backend

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

type DeviceSessionRequestSigner

type DeviceSessionRequestSigner interface {
	// SignDeviceSessionRequest produces a signed device-session-request with for given serial assertion and nonce.
	SignDeviceSessionRequest(serial *asserts.Serial, nonce string) (*asserts.DeviceSessionRequest, error)
}

type ProxyStoreer

type ProxyStoreer interface {
	// ProxyStore returns the store assertion for the proxy store if one is set.
	ProxyStore() (*asserts.Store, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL