services

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Store adapter

Store is the package state variable which contains database connections

Functions

func CheckAppConfigs

func CheckAppConfigs(w http.ResponseWriter, r *http.Request)

CheckAppConfigs accepts service config request and validates configuration settigs, basically as integrationID and integrationKey set on client Trasa Connectors (trasa-win, ssh).

func CreateService

func CreateService(w http.ResponseWriter, r *http.Request)

CreateApp creates new App. service here represents login (can be 2fa) endpoints. service details can include service name, passthru options and costum 2FA policies.

func DeleteCreds

func DeleteCreds(w http.ResponseWriter, r *http.Request)

DeleteCreds deletes stored creds from both database and tsxvault.

func DeleteService

func DeleteService(w http.ResponseWriter, r *http.Request)

DeleteService deletes Service from database.

func DownloadHostCerts

func DownloadHostCerts(w http.ResponseWriter, r *http.Request)

func GetAllServices

func GetAllServices(w http.ResponseWriter, r *http.Request)

func GetServiceDetail

func GetServiceDetail(w http.ResponseWriter, r *http.Request)

func GetUpstreamCreds

func GetUpstreamCreds(user, serviceID, serviceType, orgID string) (*models.UpstreamCreds, error)

func InitServiceStoreMock

func InitServiceStoreMock() *serviceMock

func InitStore

func InitStore(con *global.State)

InitStore initialises package state

func StoreServiceCredentials

func StoreServiceCredentials(w http.ResponseWriter, r *http.Request)

StoreServiceCredentials takes username password from client (trasa-dashboard for now) and stores it in tsxvault. It will also store the event in trasadb. This will come handy for in-app audit logs. storing it separate will also decouples our core dependency in vault

func UpdateHTTPProxy

func UpdateHTTPProxy(w http.ResponseWriter, r *http.Request)

UpdateHTTPProxy updates proxyConfig of http service.

func UpdateHostCerts

func UpdateHostCerts(w http.ResponseWriter, r *http.Request)

func UpdateSSLCerts

func UpdateSSLCerts(w http.ResponseWriter, r *http.Request)

func UpdateService

func UpdateService(w http.ResponseWriter, r *http.Request)

UpdateService should handle Service detail updates.

func ViewCreds

func ViewCreds(w http.ResponseWriter, r *http.Request)

Types

type AllServicesByType

type AllServicesByType struct {
	SSH    []models.Service `json:"ssh"`
	RDP    []models.Service `json:"rdp"`
	HTTP   []models.Service `json:"http"`
	DB     []models.Service `json:"db"`
	Radius []models.Service `json:"radius"`
	Other  []models.Service `json:"other"`
}

type ReverseProxyReq

type ReverseProxyReq struct {
	ServiceID string              `json:"serviceID"`
	Name      string              `json:"name"`
	Proxy     models.ReverseProxy `json:"proxy"`
}

type ServiceCreds

type ServiceCreds struct {
	Username   string `json:"username"`
	Credential string `json:"credential"`
	ServiceID  string `json:"serviceID"`
	Type       string `json:"type"`
}

type UpdateHostCertsReq

type UpdateHostCertsReq struct {
	CertVal   string `json:"certVal"`
	ServiceID string `json:"serviceID" validate:"required"`
}

type UpdateSSLCertsReq

type UpdateSSLCertsReq struct {
	SslKey    string `json:"sslKey"`
	SslCert   string `json:"sslCert"`
	CaCert    string `json:"caCert"`
	Username  string `json:"username"`
	ServiceID string `json:"serviceID"`
}

Jump to

Keyboard shortcuts

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