vaults_api

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TerminalRoutePattern is the http.ServeMux pattern this handler is registered under in
	// internal/app/custom.go. Everything after ".../terminal/" is forwarded verbatim to the
	// workbench's in-container ttyd server, which serves its own index page, static assets and
	// the "/ws" WebSocket endpoint off its own root — hence the trailing multi-wildcard.
	//
	// It sits under the "/api/vaults/" prefix on purpose: the session cookies this handler
	// authenticates with are scoped to middleware.CookiePath ("/api/"), so a route outside that
	// prefix would never receive them. Being more specific than the grpc-gateway's "/api/vaults/"
	// subtree pattern, http.ServeMux routes it here rather than to the gateway.
	TerminalRoutePattern = "/api/vaults/workbench/{vaultId}/terminal/{rest...}"
)
View Source
const (
	// TerminalShellRoutePattern is the http.ServeMux pattern this handler is registered under in
	// internal/app/custom.go. Everything after ".../terminal-shell/" is forwarded verbatim to the
	// workbench's in-container ttyd server, which serves its own index page, static assets and
	// the "/ws" WebSocket endpoint off its own root — hence the trailing multi-wildcard.
	//
	// Distinct from TerminalRoutePattern (which stays pointed at the in-container chat bridge):
	// this is the raw interactive terminal — tmux windows, each running its own `claude` TUI, with
	// zero shared history with the chat bridge. It sits under the "/api/vaults/" prefix for the
	// same reason TerminalRoutePattern does — see that constant's doc comment.
	TerminalShellRoutePattern = "/api/vaults/workbench/{vaultId}/terminal-shell/{rest...}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type VaultsImpl

type VaultsImpl struct {
	pb.UnimplementedVaultsAPIServer
	// contains filtered or unexported fields
}

func NewVaultsImpl

func NewVaultsImpl(
	vaultSvc service.VaultService, workbenchSvc service.WorkbenchService, terminalAuthLinks terminalAuthLinkCache,
) *VaultsImpl

func (*VaultsImpl) AcceptInvite

func (v *VaultsImpl) AcceptInvite(
	ctx context.Context,
	req *pb.AcceptInvite_Request,
) (*pb.AcceptInvite_Response, error)

func (*VaultsImpl) AddMember

func (*VaultsImpl) CloseWorkbenchTerminalTab added in v1.0.25

func (*VaultsImpl) CreateVault

func (*VaultsImpl) CreateWorkbench

func (*VaultsImpl) CreateWorkbenchTerminalTab added in v1.0.25

func (*VaultsImpl) DeleteVault

func (*VaultsImpl) DeleteWorkbench added in v1.0.25

func (*VaultsImpl) DisablePostgresDatabase added in v1.0.15

func (*VaultsImpl) EnablePostgresDatabase added in v1.0.15

func (*VaultsImpl) Gateway

func (v *VaultsImpl) Gateway(ctx context.Context, endpoint string, opts ...grpc.DialOption) (string, http.Handler)

func (*VaultsImpl) GetPostgresDatabase added in v1.0.15

func (*VaultsImpl) GetVault

func (*VaultsImpl) LinkS3Bucket

func (v *VaultsImpl) LinkS3Bucket(
	ctx context.Context,
	req *pb.LinkS3Bucket_Request,
) (*pb.LinkS3Bucket_Response, error)

func (*VaultsImpl) ListMembers

func (*VaultsImpl) ListVaults

func (*VaultsImpl) ListWorkbenchTerminalTabs added in v1.0.25

func (*VaultsImpl) PublishVault

func (*VaultsImpl) Register

func (v *VaultsImpl) Register(srv grpc.ServiceRegistrar)

func (*VaultsImpl) RemoveMember

func (v *VaultsImpl) RemoveMember(
	ctx context.Context,
	req *pb.RemoveMember_Request,
) (*pb.RemoveMember_Response, error)

func (*VaultsImpl) SelectWorkbenchTerminalTab added in v1.0.25

func (*VaultsImpl) SetVaultBinaryStorage

func (*VaultsImpl) StartWorkbench

func (v *VaultsImpl) StartWorkbench(
	ctx context.Context, req *pb.StartWorkbench_Request,
) (*pb.StartWorkbench_Response, error)

func (*VaultsImpl) StopWorkbench

func (v *VaultsImpl) StopWorkbench(
	ctx context.Context, req *pb.StopWorkbench_Request,
) (*pb.StopWorkbench_Response, error)

func (*VaultsImpl) UnlinkS3Bucket

func (v *VaultsImpl) UnlinkS3Bucket(
	ctx context.Context,
	req *pb.UnlinkS3Bucket_Request,
) (*pb.UnlinkS3Bucket_Response, error)

func (*VaultsImpl) UnpublishVault

func (*VaultsImpl) UpdateVaultPrompts added in v1.0.25

type WorkbenchTerminalHandler added in v1.0.25

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

WorkbenchTerminalHandler reverse-proxies a vault member's browser straight to the ttyd server running inside that vault's workbench container, giving the user a real interactive terminal on the workbench's tmux session (replacing the previous capture-pane/send-keys screen-scraping relay).

It is registered with transport.AddHttpHandler, i.e. outside the gRPC auth interceptor chain, so it authenticates and authorizes each request itself — same as the other raw handlers in internal/app/custom.go (mcp_api's OAuth endpoints, gitlab_webhook).

func NewWorkbenchTerminalHandler added in v1.0.25

func NewWorkbenchTerminalHandler(
	authSvc terminalAuthService, vaultMembers terminalVaultMembers, workbenchSvc terminalTargetResolver,
) *WorkbenchTerminalHandler

func (*WorkbenchTerminalHandler) ServeHTTP added in v1.0.25

type WorkbenchTerminalShellHandler added in v1.0.25

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

WorkbenchTerminalShellHandler reverse-proxies a vault member's browser straight to the ttyd server running inside that vault's workbench container, giving the user a real interactive terminal on the workbench's tmux session — one tab per tmux window, each its own live `claude` TUI, entirely independent of the chat bridge WorkbenchTerminalHandler proxies to.

It is registered with transport.AddHttpHandler, i.e. outside the gRPC auth interceptor chain, so it authenticates and authorizes each request itself — same as WorkbenchTerminalHandler and the other raw handlers in internal/app/custom.go (mcp_api's OAuth endpoints, gitlab_webhook).

func NewWorkbenchTerminalShellHandler added in v1.0.25

func NewWorkbenchTerminalShellHandler(
	authSvc terminalAuthService, vaultMembers terminalVaultMembers, workbenchSvc terminalShellTargetResolver,
) *WorkbenchTerminalShellHandler
func (h *WorkbenchTerminalShellHandler) ClearPendingTerminalAuthLink(vaultID uuid.UUID)

ClearPendingTerminalAuthLink removes vaultID's cached sign-in link — called by GetVault once a live login-status check (service.WorkbenchService.IsClaudeLoggedIn) confirms login actually completed, since this handler has no way to know that on its own (it only sees terminal scrollback, not the container's real credentials state).

func (h *WorkbenchTerminalShellHandler) PendingTerminalAuthLink(vaultID uuid.UUID) string

PendingTerminalAuthLink returns the Claude CLI OAuth sign-in link most recently detected on vaultID's terminal WS output, or "" if none has been seen yet on this process (a fresh detection overwrites any earlier one — see setPendingTerminalAuthLink) or the entry has since been cleared via ClearPendingTerminalAuthLink.

func (*WorkbenchTerminalShellHandler) ServeHTTP added in v1.0.25

Jump to

Keyboard shortcuts

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