app

package
v0.0.0-...-8b5928e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildListHostsRequest

func BuildListHostsRequest(r *http.Request) (*instances.ListHostsRequest, error)

func HostOrchestratorPath

func HostOrchestratorPath(path, host string) (string, error)

Types

type App

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

The controller implements the web API of the cloud orchestrator. It parses and validates requests from the client and passes the information to the relevant modules

func NewApp

func NewApp(
	im instances.Manager,
	am accounts.Manager,
	oc *appOAuth2.Helper,
	es encryption.Service,
	dbs database.Service,
	webStaticFilesPath string,
	corsAllowedOrigins []string,
	webRTCConfig config.WebRTCConfig,
	config *config.Config) *App

func (*App) AddCorsHeaderIfNeeded

func (c *App) AddCorsHeaderIfNeeded(w http.ResponseWriter, r *http.Request)

func (*App) AuthHandler

func (c *App) AuthHandler(w http.ResponseWriter, r *http.Request) error

func (*App) Authenticate

func (a *App) Authenticate(fn AuthHTTPHandler) HTTPHandler

Returns the received http handler wrapped in another that extracts user information from the request and passes it to to the original handler as the last parameter. The wrapper will only pass the request to the inner handler if a user is authenticated, otherwise it may choose to return an error or respond with an HTTP redirect to the login page.

func (*App) ConfigHandler

func (a *App) ConfigHandler(w http.ResponseWriter, r *http.Request, user accounts.User) error

func (*App) DeAuthHandler

func (a *App) DeAuthHandler(w http.ResponseWriter, r *http.Request, user accounts.User) error

func (*App) ForwardToHost

func (a *App) ForwardToHost(w http.ResponseWriter, r *http.Request, user accounts.User) error

func (*App) Handler

func (c *App) Handler() http.Handler

func (*App) InfraConfig

func (a *App) InfraConfig() apiv1.InfraConfig

func (*App) OAuth2Callback

func (c *App) OAuth2Callback(w http.ResponseWriter, r *http.Request) error

func (*App) RescindAuthorizationHandler

func (a *App) RescindAuthorizationHandler(w http.ResponseWriter, r *http.Request, user accounts.User) error

type AuthHTTPHandler

type AuthHTTPHandler func(http.ResponseWriter, *http.Request, accounts.User) error

type HTTPHandler

type HTTPHandler func(http.ResponseWriter, *http.Request) error

func (HTTPHandler) ServeHTTP

func (h HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Intercept errors returned by the HTTPHandler and transform them into HTTP error responses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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