envprofiles

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGatewayEnvIDReserved         = errors.New("gateway_env_id is reserved")
	ErrGatewayEnvIDInvalid          = errors.New("gateway_env_id is invalid")
	ErrURLRequired                  = errors.New("url is required")
	ErrURLMustBeAbsoluteHTTP        = errors.New("url must be an absolute http or https URL")
	ErrURLSchemeUnsupported         = errors.New("url must use http or https")
	ErrURLCredentialsUnsupported    = errors.New("url must not include embedded credentials")
	ErrURLTargetUnsafe              = errors.New("url target is not allowed by the Gateway target policy")
	ErrSSHDestinationRequired       = errors.New("ssh_destination is required")
	ErrSSHPortInvalid               = errors.New("ssh_port must be between 1 and 65535")
	ErrContainerEngineInvalid       = errors.New("container_engine must be docker or podman")
	ErrContainerIDRequired          = errors.New("container_id is required")
	ErrContainerRuntimeRootRequired = errors.New("container_runtime_root is required")
	ErrSSHPasswordAuthUnsupported   = errors.New("ssh password auth is not supported for gateway environment profiles yet")
)

Functions

func EnvironmentFromProfile

func EnvironmentFromProfile(profile EnvironmentProfile) protocol.Environment

func EnvironmentFromProfileWithEditableRoute

func EnvironmentFromProfileWithEditableRoute(profile EnvironmentProfile) protocol.Environment

func URLTargetAllowed

func URLTargetAllowed(host string, policy URLTargetPolicy) bool

func URLTargetIPAllowed

func URLTargetIPAllowed(ip net.IP, policy URLTargetPolicy) bool

Types

type EnvironmentProfile

type EnvironmentProfile struct {
	GatewayEnvID    string                          `json:"gateway_env_id"`
	DisplayName     string                          `json:"display_name"`
	AccessRoute     protocol.EnvProfileAccessRoute  `json:"access_route"`
	ControlOwner    protocol.EnvProfileControlOwner `json:"control_owner"`
	SSHPasswordSet  bool                            `json:"ssh_password_set,omitempty"`
	CreatedAtUnixMS int64                           `json:"created_at_unix_ms"`
	UpdatedAtUnixMS int64                           `json:"updated_at_unix_ms"`
}

type Store

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

func NewStore

func NewStore(filePath string) *Store

func NewStoreWithOptions

func NewStoreWithOptions(filePath string, options StoreOptions) *Store

func (*Store) Get

func (s *Store) Get(ctx context.Context, gatewayEnvID string) (EnvironmentProfile, bool, error)

func (*Store) List

func (s *Store) List(ctx context.Context) ([]EnvironmentProfile, error)

func (*Store) Upsert

type StoreOptions

type StoreOptions struct {
	URLTargetPolicy URLTargetPolicy
}

type URLTargetPolicy

type URLTargetPolicy struct {
	AllowPrivateNetworkTargets bool
	AllowLoopbackTargets       bool
}

Jump to

Keyboard shortcuts

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