Documentation
¶
Index ¶
- func AutenticationErrorHandler(w http.ResponseWriter, r *http.Request)
- func MakeDownloadFilesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeFixedSecretHandler(secret string, f http.HandlerFunc) http.HandlerFunc
- func MakeJSessionCategoriesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeJSessionCategoryHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeJSessionJobManipulationHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeJSessionSubmitHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeListFilesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMSessionDRMSLoadHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMSessionDRMSNameHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMSessionDRMSVersionHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMSessionJobInfoHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMSessionJobInfosHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMachineHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeMachinesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeQueueHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeQueuesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeRunLocalHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeSessionListHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeUCFileUploadHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
- func MakeYubikeyHandler(id, key string, allowedIDs []string, f http.HandlerFunc) http.HandlerFunc
- func NewProxyRouter(impl ProxyImplementer, sc SecConfig, pi persistency.PersistencyImplementer) *mux.Router
- func ProxyListenAndServe(addr, certFile, keyFile string, sc SecConfig, ...)
- func ReadTrustedClientCertPool(directory string) (*x509.CertPool, error)
- type ProxyImplementer
- type Route
- type Routes
- type RunJobResult
- type SecConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutenticationErrorHandler ¶
func AutenticationErrorHandler(w http.ResponseWriter, r *http.Request)
func MakeDownloadFilesHandler ¶
func MakeDownloadFilesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeDownloadFilesHandler returns an http handler function which serves a file requested with the *name* http request.
func MakeFixedSecretHandler ¶
func MakeFixedSecretHandler(secret string, f http.HandlerFunc) http.HandlerFunc
MakeFixedSecretHandler protects an http handler by a simple shared secret given a request or a post form value. Note that without TLS it is not encrypted through the network and it can be sniffed.
func MakeJSessionCategoriesHandler ¶
func MakeJSessionCategoriesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionDRMSVersionHandler returns an http handler function which returns all available DRMAA2 job categories as JSON encoded string.
func MakeJSessionCategoryHandler ¶
func MakeJSessionCategoryHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeJSessionCategroyHandler returns an http handler function which returns a requested job category when it is available.
func MakeJSessionJobManipulationHandler ¶
func MakeJSessionJobManipulationHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeJSessionJobManipulationHandler returns an http handler function which calls the JobOperation function defined by an ProxyImplementer.
func MakeJSessionSubmitHandler ¶
func MakeJSessionSubmitHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeJSessionSubmitHandler returns an http handler function which reads in a DRMAA2 job template struct (in JSON) in the body of the http request. In case of success the job is submitted in the cluster using the RunJob function implemented by the proxy. TODO In case a ProxyImplementer is given as a parameter the job template is made persistent.
func MakeListFilesHandler ¶
func MakeListFilesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeListFilesHandler creates an http handler function which returns a list of all files in the staging area over http.
func MakeMSessionDRMSLoadHandler ¶
func MakeMSessionDRMSLoadHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionDRMSLoadHandler returns an http handler function which returns the DRMS encoded load by the ProxyImplementer as JSON string.
func MakeMSessionDRMSNameHandler ¶
func MakeMSessionDRMSNameHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionDRMSNameHandler returns an http handler function which returns the DRMS name encoded by the ProxyImplementer as JSON string.
func MakeMSessionDRMSVersionHandler ¶
func MakeMSessionDRMSVersionHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionDRMSVersionHandler returns an http handler function which returns the DRMS name encoded by the ProxyImplementer as JSON string.
func MakeMSessionJobInfoHandler ¶
func MakeMSessionJobInfoHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionJobInfoHandler returns an http handler function which returns a JSON encoded DRMAA2 Job Info object.
func MakeMSessionJobInfosHandler ¶
func MakeMSessionJobInfosHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMSessionJobInfosHandler retuns an http handler function which returns a JSON encoded collection of DRMAA2 job info object of all jobs available.
func MakeMachineHandler ¶
func MakeMachineHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMachineHandler retuns an http handler function which returns a JSON encoded DRMAA2 machine object if the machine is part of the DRM system.
func MakeMachinesHandler ¶
func MakeMachinesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeMachinesHandler returns an http handler function which returns a JSON encoded collection of all machines availale in the DRM.
func MakeQueueHandler ¶
func MakeQueueHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeQueueHandler returns an http handler function which returns the requested queue if it is available on the system JSON encoded.
func MakeQueuesHandler ¶
func MakeQueuesHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeQueuesHandler retuns an http handler function which returns all available queues in the DRM system JSON encoded.
func MakeRunLocalHandler ¶
func MakeRunLocalHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeRunLocalHandler spawns a process on the same host as proxy.
func MakeSessionListHandler ¶
func MakeSessionListHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
MakeSessionListHandler implements an http handler which serves a list of (DRMAA2) job sessions available on this proxy.
func MakeUCFileUploadHandler ¶
func MakeUCFileUploadHandler(impl ProxyImplementer, pi persistency.PersistencyImplementer) http.HandlerFunc
func MakeYubikeyHandler ¶
func MakeYubikeyHandler(id, key string, allowedIDs []string, f http.HandlerFunc) http.HandlerFunc
MakeYubikeyHandler creates an http handler which is protected by an yubkikey one-time-password verification. The OTP needs to be given by either a form value ("otp") or a POST form value ("otp").
func NewProxyRouter ¶
func NewProxyRouter(impl ProxyImplementer, sc SecConfig, pi persistency.PersistencyImplementer) *mux.Router
NewProxyRouter creates a mux router for matching http requests to handlers. When security is configured it adds neccessary closures around the functions.
func ProxyListenAndServe ¶
func ProxyListenAndServe(addr, certFile, keyFile string, sc SecConfig, pi persistency.PersistencyImplementer, impl ProxyImplementer)
ProxyListenAndServe starts an http proxy for a cluster which is accessed by functions specified in the ProxyImplementer interface. If a certification and key file is given as parameter then it starts an TLS secured http proxy. The port is specified by addr in the form which is used by http.ListenAndServe.
Types ¶
type ProxyImplementer ¶
type ProxyImplementer interface { GetJobInfosByFilter(filtered bool, filter types.JobInfo) []types.JobInfo GetJobInfo(jobid string) *types.JobInfo GetAllMachines(machines []string) ([]types.Machine, error) GetAllQueues(queues []string) ([]types.Queue, error) GetAllCategories() ([]string, error) GetAllSessions(session []string) ([]string, error) DRMSVersion() string DRMSName() string RunJob(template types.JobTemplate) (string, error) JobOperation(jobsessionname, operation, jobid string) (string, error) DRMSLoad() float64 }
ProxyImplementer interface specified functions required to interface a ubercluster proxy. Those functions are called in the standard http request handlers.
type Route ¶
type Route struct { Name string Method string Pattern string MakeHandlerFunc func(ProxyImplementer, persistency.PersistencyImplementer) http.HandlerFunc }
Route is a structure which maps a name, method, and a http request pattern to a http handler function which is executed.
type RunJobResult ¶
type RunJobResult struct {
JobId string `json:"jobid"`
}
RunJobResult is the JSON answer when a job could successully started in the cluster.
type SecConfig ¶
type SecConfig struct { OTP string // secret key or "yubikey" YubiID string // ID of yubiservice in case of yubikey https://upgrade.yubico.com/getapikey/ YubiSecret string // Secret of yubiservice in case of yubikey https://upgrade.yubico.com/getapikey/ YubiAllowedIDs []string // IDs of yubkeys which are allowed TrustedClientCertDir string // Directory which contains trusted certs for mutual TLS }
SecConfig stores security related configuration settings for the ubercluster Proxy