service

package
v0.0.0-...-66155ff Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserRuntimeDir = "/run/user"
	AuthTableFile  = "tokens.json"
)
View Source
const (
	CONFIG_URL_GOOGLE = "https://accounts.google.com/.well-known/openid-configuration"
)
View Source
const (
	DefaultServiceTimeout = 60 * time.Second
)

Variables

This section is empty.

Functions

func GetAuthToken

func GetAuthToken(uid string, vmid string) (string, error)

func IsLoggedIn

func IsLoggedIn(uid string, vmid string) (string, bool)

func RemoveAuthToken

func RemoveAuthToken(uid string, vmid string) error

func UpdateAuthToken

func UpdateAuthToken(uid string, t AuthTable) error

Types

type AconClient

type AconClient interface {
	AddManifest(manifestPath, sigPath, certPath string) (string, []string, error)
	AddBlob(alg uint32, blobpath string) error
	Finalize() error
	Start(imageId string, env []string) (uint32, error)
	Kill(cid uint32, signum int32) error
	Restart(cid uint32, timeout uint64) error
	Invoke(cid uint32, invocation []string, timeout uint64,
		env []string, datafile string, capSize uint64) ([]byte, []byte, error)
	Inspect(cid uint32) ([]AconStatus, error)
	Report(nonceLow, nonceHigh uint64, reportType uint32) (data []byte, mrlog0 []string,
		mrlog1 []string, mrlog2 []string,
		mrlog3 []string, attestData string,
		e error)
}

type AconClientGrpc

type AconClientGrpc struct {
	pb.AconServiceClient
	// contains filtered or unexported fields
}

func NewAconGrpcConnection

func NewAconGrpcConnection(targetConn string) (*AconClientGrpc, error)

caller's responsibility to call Close() on the returned AconClient after using the agent services

func (*AconClientGrpc) AddBlob

func (c *AconClientGrpc) AddBlob(alg uint32, blobpath string) error

func (*AconClientGrpc) AddManifest

func (c *AconClientGrpc) AddManifest(manifestPath, sigPath, certPath string) (string, []string, error)

func (*AconClientGrpc) Close

func (c *AconClientGrpc) Close() error

func (*AconClientGrpc) Finalize

func (c *AconClientGrpc) Finalize() error

func (*AconClientGrpc) Inspect

func (c *AconClientGrpc) Inspect(cid uint32) ([]AconStatus, error)

func (*AconClientGrpc) Invoke

func (c *AconClientGrpc) Invoke(cid uint32, invocation []string,
	timeout uint64, env []string, datafile string, capture_size uint64) ([]byte, []byte, error)

func (*AconClientGrpc) Kill

func (c *AconClientGrpc) Kill(cid uint32, signum int32) error

func (*AconClientGrpc) Report

func (c *AconClientGrpc) Report(nonceLo, nonceHi uint64, requestType uint32) (data []byte,
	mrlog0 []string, mrlog1 []string, mrlog2 []string, mrlog3 []string, attest_data string, e error)

func (*AconClientGrpc) Restart

func (c *AconClientGrpc) Restart(cid uint32, timeout uint64) error

func (*AconClientGrpc) Start

func (c *AconClientGrpc) Start(imageId string, env []string) (uint32, error)

type AconClientHttp

type AconClientHttp struct {
	// contains filtered or unexported fields
}

func NewAconHttpConnWithOpts

func NewAconHttpConnWithOpts(host string, opts ...Opt) (*AconClientHttp, error)

func (*AconClientHttp) AddBlob

func (c *AconClientHttp) AddBlob(alg uint32, blobpath string) error

func (*AconClientHttp) AddManifest

func (c *AconClientHttp) AddManifest(manifest, sig, cert string) (string, []string, error)

func (*AconClientHttp) Finalize

func (c *AconClientHttp) Finalize() error

func (*AconClientHttp) Inspect

func (c *AconClientHttp) Inspect(cid uint32) ([]AconStatus, error)

func (*AconClientHttp) Invoke

func (c *AconClientHttp) Invoke(cid uint32, invocation []string,
	timeout uint64, env []string, datafile string, capture_size uint64) ([]byte, []byte, error)

func (*AconClientHttp) Kill

func (c *AconClientHttp) Kill(cid uint32, signum int32) error

func (*AconClientHttp) Login

func (c *AconClientHttp) Login(uid string) error

func (*AconClientHttp) Logout

func (c *AconClientHttp) Logout(uid string) error

func (*AconClientHttp) Report

func (c *AconClientHttp) Report(nonceLo, nonceHi uint64, reqType uint32) (data []byte,
	mrlog0 []string, mrlog1 []string, mrlog2 []string, mrlog3 []string, attest_data string, e error)

func (*AconClientHttp) Restart

func (c *AconClientHttp) Restart(cid uint32, timeout uint64) error

func (*AconClientHttp) Start

func (c *AconClientHttp) Start(imageId string, env []string) (uint32, error)

type AconStatus

type AconStatus struct {
	ContainerId uint32 `json:"container_id"`
	State       uint32 `json:"state"`
	Wstatus     int32  `json:"wstatus"`
	ImageId     string `json:"image_id"`
	ExePath     string `json:"exe_path"`
}

type AddManifestResponse

type AddManifestResponse struct {
	ImageId       string   `json:"image_id"`
	MissingLayers []string `json:"missing_layers"`
}

type AuthCode

type AuthCode struct {
	DeviceCode      string `json:"device_code"`
	Expiration      uint   `json:"expires_in"`
	Interval        uint   `json:"interval"`
	UserCode        string `json:"user_code"`
	VerificationURL string `json:"verification_url"`
}

type AuthTable

type AuthTable map[string]string

map vmid to associated access token

type ExecResponse

type ExecResponse struct {
	Stdout []byte `json:"stdout"`
	Stderr []byte `json:"stderr"`
}

type GetManifestResponse

type GetManifestResponse struct {
	Manifest    string `json:"manifest"`
	Certificate []byte `json:"certificate"`
}

type InspectResponse

type InspectResponse struct {
	Info []AconStatus `json:"info"`
}

type MrLog

type MrLog struct {
	Logs []string `json:"logs"`
}

type OpenidConfig

type OpenidConfig struct {
	DeviceAuthEndpoint string `json:"device_authorization_endpoint"`
}

type Opt

type Opt func(*AconClientHttp) error

func OptDialTLSContext

func OptDialTLSContext(caCertFilePath string) Opt

func OptDialTLSContextInsecure

func OptDialTLSContextInsecure() Opt

func OptNoAuth

func OptNoAuth() Opt

func OptTimeout

func OptTimeout(timeout time.Duration) Opt

type ReportResponse

type ReportResponse struct {
	Data            []byte           `json:"data"`
	Mrlogs          map[uint32]MrLog `json:"mrlog"`
	AttestationData string           `json:"attestationData"`
}

type StartResponse

type StartResponse struct {
	ContainerId uint32 `json:"container_id"`
}

Jump to

Keyboard shortcuts

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