Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + var ErrInvalidAuth = fmt.Errorf("invalid authentication") + var ErrInvalidUser = errors.New("invalid user") + func EnsureContextTODO() context.Context + func IsEnsureContext(ctx context.Context) bool + func MacaroonDeserialize(serializedMacaroon string) (*macaroon.Macaroon, error) + func MacaroonSerialize(m *macaroon.Macaroon) (string, error) + func UpdateUser(st *state.State, user *UserState) error + type AuthState struct + Device *DeviceState + LastID int + MacaroonKey []byte + Users []UserState + type CloudInfo struct + AvailabilityZone string + Name string + Region string + type DeviceState struct + Brand string + KeyID string + Model string + Serial string + SessionMacaroon string + type NewUserParams struct + Discharges []string + Email string + Expiration time.Time + Macaroon string + Username string + type UserState struct + Discharges []string + Email string + Expiration time.Time + ID int + Macaroon string + StoreDischarges []string + StoreMacaroon string + Username string + func CheckMacaroon(st *state.State, macaroon string, discharges []string) (*UserState, error) + func NewUser(st *state.State, userParams NewUserParams) (*UserState, error) + func RemoveUser(st *state.State, userID int) (removed *UserState, err error) + func RemoveUserByUsername(st *state.State, username string) (removed *UserState, err error) + func User(st *state.State, id int) (*UserState, error) + func UserByUsername(st *state.State, username string) (*UserState, error) + func Users(st *state.State) ([]*UserState, error) + func (u *UserState) HasExpired() bool + func (u *UserState) HasStoreAuth() bool