Documentation
¶
Index ¶
- Variables
- func ClearContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error
- func ContainerIDForStub(stubId string) string
- func GenerateShellCredentials() (string, string, error)
- func IsStandaloneContainer(containerId string) bool
- func RefreshContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error
- func RefreshPendingContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error
- func SetInitialContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error
- func StandaloneEntryPoint() []string
- type SSHShellService
- func (ss *SSHShellService) CreateShellInExistingContainer(ctx context.Context, in *pb.CreateShellInExistingContainerRequest) (*pb.CreateShellInExistingContainerResponse, error)
- func (ss *SSHShellService) CreateStandaloneShell(ctx context.Context, in *pb.CreateStandaloneShellRequest) (*pb.CreateStandaloneShellResponse, error)
- type ShellService
- type ShellServiceOpts
Constants ¶
This section is empty.
Variables ¶
var ErrShellLeaseExpired = errors.New("shell lease no longer exists")
var Keys = &keys{}
Functions ¶
func ClearContainerTTL ¶
func ContainerIDForStub ¶
func GenerateShellCredentials ¶
GenerateShellCredentials returns credentials that are independent from the caller's API token. A compromised or replaced SSH daemon must never receive a reusable Beam/Beta9 bearer token during password authentication.
func IsStandaloneContainer ¶
func RefreshContainerTTL ¶
RefreshContainerTTL extends an existing connected-shell lease without resurrecting a lease that has already expired.
func RefreshPendingContainerTTL ¶
func RefreshPendingContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error
RefreshPendingContainerTTL grants time for a user to run a returned shell command. The shorter connected lease starts only once the HTTP tunnel opens.
func SetInitialContainerTTL ¶
SetInitialContainerTTL marks a shell container as pending; the shell service stops the container when the TTL lapses without a client keepalive.
func StandaloneEntryPoint ¶
func StandaloneEntryPoint() []string
StandaloneEntryPoint is the dropbear-based startup used by standalone shells: provision the SSH user, then run the SSH server in the foreground.
Types ¶
type SSHShellService ¶
type SSHShellService struct {
pb.UnimplementedShellServiceServer
// contains filtered or unexported fields
}
func (*SSHShellService) CreateShellInExistingContainer ¶
func (ss *SSHShellService) CreateShellInExistingContainer(ctx context.Context, in *pb.CreateShellInExistingContainerRequest) (*pb.CreateShellInExistingContainerResponse, error)
func (*SSHShellService) CreateStandaloneShell ¶
func (ss *SSHShellService) CreateStandaloneShell(ctx context.Context, in *pb.CreateStandaloneShellRequest) (*pb.CreateStandaloneShellResponse, error)
type ShellService ¶
type ShellService interface {
pb.ShellServiceServer
CreateStandaloneShell(ctx context.Context, in *pb.CreateStandaloneShellRequest) (*pb.CreateStandaloneShellResponse, error)
CreateShellInExistingContainer(ctx context.Context, in *pb.CreateShellInExistingContainerRequest) (*pb.CreateShellInExistingContainerResponse, error)
}
func NewSSHShellService ¶
func NewSSHShellService( ctx context.Context, opts ShellServiceOpts, ) (ShellService, error)
type ShellServiceOpts ¶
type ShellServiceOpts struct {
Config types.AppConfig
RedisClient *common.RedisClient
BackendRepo repository.BackendRepository
ComputeRepo repository.ComputeRepository
WorkspaceRepo repository.WorkspaceRepository
ContainerRepo repository.ContainerRepository
WorkerRepo repository.WorkerRepository
WorkerPoolRepo repository.WorkerPoolRepository
Scheduler *scheduler.Scheduler
RouteGroup *echo.Group
Tailscale *network.Tailscale
EventRepo repository.EventRepository
}