testutils

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 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockOrgID  = "153f7582-5ae2-46ba-8c1c-79ef73fe296e"
	MockUserID = "13c45cfb-72ca-4177-b968-03604cab6a27"

	MockTrasaID      = "root"
	MockTrasaID2     = "bhbha@gmail.com"
	MocktrasaPass    = "changeme"
	MocktrasaPass2   = "Changeme@123"
	MocktotpSEC      = "AV2COXZHVG4OAFSF"
	MockupstreamUser = "root"
	MockupstreamPass = "root"

	MockHostCert = `` /* 160-byte string literal not displayed */

	MockPrivateKey = `` /* 2621-byte string literal not displayed */

)

Variables

View Source
var MockPrivateKey2 = `` /* 2621-byte string literal not displayed */
View Source
var Mockupgrader = websocket.Upgrader{
	CheckOrigin: func(r *http.Request) bool {

		return true
	},
	Subprotocols: []string{"trasa", "guacamole", "livesessions", "xterm"},
}

Functions

func AddTestSelfUserContext added in v1.1.2

func AddTestSelfUserContext(next http.HandlerFunc) http.HandlerFunc

AddTestUserContext is a middleware that adds mock userContext

func AddTestUserContext

func AddTestUserContext(next http.HandlerFunc) http.HandlerFunc

AddTestUserContext is a middleware that adds mock userContext

func AddTestUserContextWS

func AddTestUserContextWS(next func(params models.ConnectionParams, uc models.UserContext, ws *websocket.Conn)) http.HandlerFunc

AddTestUserContextWS is a middleware that adds mock userContext to ws handlers

func GetReqWithBody

func GetReqWithBody(t *testing.T, body interface{}) *http.Request

func GetTotpCode

func GetTotpCode(secret string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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