userspace

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 11 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	DeviceID string `json:"deviceID,omitempty"`
	Name     string `json:"name,omitempty"`
	Type     string `json:"type,omitempty"`

	Enabled bool `json:"enabled"`

	RSAPrivateKey string `json:"rsaPrivateKey,omitempty"`
	RSAPublicKey  string `json:"rsaPublicKey,omitempty"`

	DeviceUsers []*User `json:"-"`
}

func (*Device) UpdateKeys

func (d *Device) UpdateKeys() error

type Space

type Space struct {
	SpaceID   string `json:"spaceID"`
	SpaceName string `json:"spaceName"`

	PublicKey   string `json:"publicKey"`
	Certificate string `json:"certificate"`

	Cookbook string
	Recipe   string
	IaaS     string
	Region   string
	Version  string

	IsEgressNode bool

	Status   string `json:"status"`
	LastSeen uint64

	// space access for
	// user in context
	IsOwned      bool
	IsAdmin      bool
	AccessStatus string

	IPAddress   string `json:"ipAddress"`
	FQDN        string `json:"fqdn"`
	Port        int    `json:"port"`
	VpnType     string
	LocalCARoot string `json:"localCARoot"`
}

func (*Space) CanUseAsEgressNode

func (s *Space) CanUseAsEgressNode() bool

func (*Space) CreateDeviceConnectKeyPair

func (s *Space) CreateDeviceConnectKeyPair() (string, string, error)

func (*Space) GetApiCARoot

func (s *Space) GetApiCARoot() string

func (*Space) GetEndpoint

func (s *Space) GetEndpoint() (string, error)

func (*Space) GetIaaS

func (s *Space) GetIaaS() string

func (*Space) GetLastSeen

func (s *Space) GetLastSeen() uint64

func (*Space) GetPublicKey

func (s *Space) GetPublicKey() string

func (*Space) GetRecipe

func (s *Space) GetRecipe() string

func (*Space) GetRegion

func (s *Space) GetRegion() string

func (*Space) GetSpaceID

func (s *Space) GetSpaceID() string

func (*Space) GetSpaceName

func (s *Space) GetSpaceName() string

func (*Space) GetStatus

func (s *Space) GetStatus() string

func (*Space) GetVersion

func (s *Space) GetVersion() string

func (*Space) HasAdminAccess

func (s *Space) HasAdminAccess() bool

func (*Space) IsRunning

func (s *Space) IsRunning() bool

func (*Space) IsSpaceOwned

func (s *Space) IsSpaceOwned() bool

func (*Space) Key

func (s *Space) Key() string

func (*Space) RestApiClient

func (s *Space) RestApiClient(ctx context.Context) (*rest.RestApiClient, error)

type SpaceCollection

type SpaceCollection []SpaceNode

sorter to order spaces in order of recipe, cloud, region and deployment name

func (SpaceCollection) Len

func (sc SpaceCollection) Len() int

func (SpaceCollection) Less

func (sc SpaceCollection) Less(i, j int) bool

func (SpaceCollection) Swap

func (sc SpaceCollection) Swap(i, j int)

type SpaceNode

type SpaceNode interface {

	// a key for the space node
	Key() string

	GetSpaceID() string
	GetSpaceName() string
	GetPublicKey() string

	GetRecipe() string
	GetIaaS() string
	GetRegion() string
	GetVersion() string

	GetStatus() string
	GetLastSeen() uint64

	IsRunning() bool

	IsSpaceOwned() bool
	HasAdminAccess() bool
	CanUseAsEgressNode() bool

	GetApiCARoot() string
	GetEndpoint() (string, error)
	RestApiClient(ctx context.Context) (*rest.RestApiClient, error)

	CreateDeviceConnectKeyPair() (string, string, error)
}

type SpaceUser

type SpaceUser struct {
	UserID string `json:"userID"`
	Name   string `json:"name"`

	IsOwner bool `json:"isOwner"`
	IsAdmin bool `json:"isAdmin"`

	// active devices for this users
	Devices []*Device `json:"devices,omitempty"`
}

type User

type User struct {
	UserID string `json:"userID"`
	Name   string `json:"name"`

	KeyTimestamp  int64  `json:"keyTimestamp,omitempty"`
	RSAPrivateKey string `json:"rsaPrivateKey,omitempty"`
	RSAPublicKey  string `json:"rsaPublicKey,omitempty"`

	Certificate string `json:"certificate,omitempty"`

	// indicates if user is active
	// for the device in context
	Active bool `json:"active"`

	FirstName     string `json:"-"`
	MiddleName    string `json:"-"`
	FamilyName    string `json:"-"`
	PreferredName string `json:"-"`
	// contains filtered or unexported fields
}

func (*User) DecryptConfig

func (u *User) DecryptConfig(configData string) ([]byte, error)

func (*User) EncryptConfig

func (u *User) EncryptConfig(configData []byte) (string, error)

func (*User) SetKey

func (u *User) SetKey(key *crypto.RSAKey) error

Jump to

Keyboard shortcuts

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