terminal

package
v0.0.0-...-ac6872c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProxyEndpoint path that that Proxy is supposed to handle
	ProxyEndpoint = "/api/terminal/proxy/"
	// AvailableEndpoint path used to check if functionality is enabled
	AvailableEndpoint = "/api/terminal/available/"
	// WorkspaceInitEndpoint is used to initialize a kubeconfig in the workspace
	WorkspaceInitEndpoint = "exec/init"
	// WorkspaceActivityEndpoint is used to prevent idle timeout in a workspace
	WorkspaceActivityEndpoint = "activity/tick"
	// WorkspaceCreatorLabel stores the UID of the user that created the workspace. Only this user should be able to
	// access the workspace
	WorkspaceCreatorLabel = "controller.devfile.io/creator"
	// WorkspaceRestrictedAcccessAnnotation signifies that a workspace expects webhooks to be enabled. If they are not,
	// startup is blocked.
	WorkspaceRestrictedAcccessAnnotation = "controller.devfile.io/restricted-access"
)

Variables

View Source
var (
	WorkspaceGroupVersionResource = schema.GroupVersionResource{
		Group:    "workspace.devfile.io",
		Version:  "v1alpha1",
		Resource: "devworkspaces",
	}

	UserGroupVersionResource = schema.GroupVersionResource{
		Group:    "user.openshift.io",
		Version:  "v1",
		Resource: "users",
	}
)

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	TLSClientConfig *tls.Config
	ClusterEndpoint *url.URL
	// contains filtered or unexported fields
}

Proxy provides handlers to handle terminal related requests

func NewProxy

func NewProxy(serviceTLS *tls.Config, TLSClientConfig *tls.Config, clusterEndpoint *url.URL) *Proxy

func (*Proxy) HandleProxy

func (p *Proxy) HandleProxy(user *auth.User, w http.ResponseWriter, r *http.Request)

HandleProxy evaluates the namespace and workspace names from URL and after check that it's created by the current user - proxies the request there

func (*Proxy) HandleProxyEnabled

func (p *Proxy) HandleProxyEnabled(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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