sshgateway

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizedGrantsHeader = "X-SSH-Key-Grants"

AuthorizedGrantsHeader carries team/user grants derived from a verified SSH key. The header is only sent on the internal ssh-gateway to regional-gateway route.

Variables

This section is empty.

Functions

func EncodeAuthorizedGrants added in v0.3.0

func EncodeAuthorizedGrants(grants []AuthorizedGrant) string

EncodeAuthorizedGrants formats SSH key grants for an internal HTTP header.

func UserIDForTeam added in v0.3.0

func UserIDForTeam(grants []AuthorizedGrant, teamID string) (string, bool)

UserIDForTeam returns the user authorized for teamID by the SSH key grants.

Types

type AuthorizedGrant added in v0.3.0

type AuthorizedGrant struct {
	TeamID string
	UserID string
}

AuthorizedGrant identifies one team/user pair authorized by an SSH key.

func ParseAuthorizedGrants added in v0.3.0

func ParseAuthorizedGrants(raw string) []AuthorizedGrant

ParseAuthorizedGrants parses SSH key grants from an internal HTTP header.

type ConnectionInfo

type ConnectionInfo struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
}

ConnectionInfo describes how a user can reach a sandbox over SSH.

func BuildConnectionInfo

func BuildConnectionInfo(host string, port int, sandboxID string) *ConnectionInfo

BuildConnectionInfo returns a user-facing SSH connection payload when the region-scoped SSH endpoint is configured.

type ResolvedTarget

type ResolvedTarget struct {
	SandboxID string `json:"sandbox_id"`
	TeamID    string `json:"team_id"`
	UserID    string `json:"user_id"`
	ProcdURL  string `json:"procd_url"`
}

ResolvedTarget describes the authorized sandbox runtime target returned by the regional SSH routing surface.

Jump to

Keyboard shortcuts

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