Documentation
¶
Overview ¶
Package web implements web proxy handler that provides web interface to view and connect to teleport nodes
Index ¶
- Constants
- func ClearSession(w http.ResponseWriter) error
- func CreateSignupLink(hostPort string, token string) string
- func EncodeCookie(user, sid string) (string, error)
- func NewHandler(cfg Config, opts ...HandlerOption) (http.Handler, error)
- func SetSession(w http.ResponseWriter, user, sid string) error
- type Config
- type Handler
- type HandlerOption
- type SSHLoginResponse
- type Server
- type SessionCookie
Constants ¶
const ( // HTTPS is https prefix HTTPS = "https" // WSS is secure web sockets prefix WSS = "wss" )
const Version = "v1"
Version is a current webapi version
Variables ¶
This section is empty.
Functions ¶
func ClearSession ¶ added in v1.0.0
func ClearSession(w http.ResponseWriter) error
func CreateSignupLink ¶
CreateSignupLink generates and returns a URL which is given to a new user to complete registration with Teleport via Web UI
func EncodeCookie ¶
func NewHandler ¶ added in v1.0.0
func NewHandler(cfg Config, opts ...HandlerOption) (http.Handler, error)
NewHandler returns a new instance of web proxy handler
func SetSession ¶ added in v1.0.0
func SetSession(w http.ResponseWriter, user, sid string) error
Types ¶
type Config ¶ added in v1.0.0
type Config struct {
// InsecureHTTPMode tells whether handler is running
// in HTTP only that is considered insecure (as opposed to HTTPS)
InsecureHTTPMode bool
// Proxy is a reverse tunnel proxy that handles connections
// to various sites
Proxy reversetunnel.Server
// AssetsDir is a directory with web assets (js files, css files)
AssetsDir string
// AuthServers is a list of auth servers this proxy talks to
AuthServers utils.NetAddr
// DomainName is a domain name served by web handler
DomainName string
}
Config represents web handler configuration parameters
type Handler ¶ added in v1.0.0
type Handler struct {
httprouter.Router
sync.Mutex
// contains filtered or unexported fields
}
Handler is HTTP web proxy handler
type HandlerOption ¶ added in v1.0.0
HandlerOption is a functional argument - an option that can be passed to NewHandler function
func SetSessionStreamPollPeriod ¶ added in v1.0.0
func SetSessionStreamPollPeriod(period time.Duration) HandlerOption
SetSessionStreamPollPeriod sets polling period for session streams
type SSHLoginResponse ¶ added in v1.0.0
type SSHLoginResponse struct {
// Cert is a signed certificate
Cert []byte `json:"cert"`
// HostSigners is a list of signing host public keys
// trusted by proxy
HostSigners []services.CertAuthority `json:"host_signers"`
}
SSHLoginResponse is a response returned by web proxy
func SSHAgentLogin ¶
func SSHAgentLogin(proxyAddr, user, password, hotpToken string, pubKey []byte, ttl time.Duration, insecure bool) (*SSHLoginResponse, error)
SSHAgentLogin issues call to web proxy and receives temp certificate if credentials are valid
proxyAddr must be specified as host:port
type SessionCookie ¶ added in v1.0.0
SessionCookie stores information about active user and session
func DecodeCookie ¶
func DecodeCookie(b string) (*SessionCookie, error)