Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParseSSHUsername ¶
ParseSSHUsername extracts the sandbox ID from the SSH username. V1 only supports <sandbox_id> or <sandbox_id>+main.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator resolves the uploaded SSH public key to a user and asks the regional routing layer to authorize and resolve the sandbox runtime target.
func NewAuthenticator ¶
func NewAuthenticator(repo identityStore, resolver sandboxResolver, resumeTimeout, pollInterval time.Duration, logger *zap.Logger) *Authenticator
NewAuthenticator creates a new SSH authenticator.
func (*Authenticator) Authenticate ¶
func (a *Authenticator) Authenticate(ctx context.Context, username string, key ssh.PublicKey) (*SessionTarget, error)
Authenticate resolves the SSH public key to a user, authorizes the sandbox, and waits for the regional routing layer to report a reachable procd target.
type Option ¶ added in v0.8.0
type Option func(*Server)
Option configures optional ssh-gateway server behavior.
func WithMetrics ¶ added in v0.8.0
func WithMetrics(metrics *obsmetrics.SSHGatewayMetrics) Option
WithMetrics enables ssh-gateway service metrics on the server.
type RegionalSandboxResolver ¶
type RegionalSandboxResolver struct {
// contains filtered or unexported fields
}
RegionalSandboxResolver resolves sandbox runtime targets through the regional-gateway internal SSH routing surface.
func NewRegionalSandboxResolver ¶
func NewRegionalSandboxResolver(baseURL string, internalAuthGen *internalauth.Generator, logger *zap.Logger, timeout time.Duration) *RegionalSandboxResolver
func (*RegionalSandboxResolver) ResolveSandbox ¶
func (r *RegionalSandboxResolver) ResolveSandbox(ctx context.Context, sandboxID string, grants []sharedssh.AuthorizedGrant) (*sharedssh.ResolvedTarget, error)
func (*RegionalSandboxResolver) SetHTTPClient ¶ added in v0.3.0
func (r *RegionalSandboxResolver) SetHTTPClient(httpClient *http.Client)
SetHTTPClient replaces the resolver HTTP client.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves SSH connections and bridges sessions to procd contexts.
func NewServer ¶
func NewServer(cfg *config.SSHGatewayConfig, authorizer SessionAuthorizer, dataPlaneAuthGen *internalauth.Generator, logger *zap.Logger, opts ...Option) (*Server, error)
NewServer creates a new ssh-gateway server.
func (*Server) Serve ¶
Serve accepts SSH connections on the supplied listener until the context is canceled.
func (*Server) SetHTTPClient ¶ added in v0.3.0
SetHTTPClient replaces the HTTP client used for procd requests.
type SessionAuthorizer ¶
type SessionAuthorizer interface {
Authenticate(ctx context.Context, username string, key ssh.PublicKey) (*SessionTarget, error)
}
SessionAuthorizer authenticates an SSH public key and resolves the sandbox target.