test

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOidcTokenStringHandler

func CreateOidcTokenStringHandler(issuer string, clientId string, userName string) func(j *Jwt) string

func ExpectErrorMessage

func ExpectErrorMessage(resp *http.Response, expectedMsg string)

func ExpectRegexErrorMessage

func ExpectRegexErrorMessage(resp *http.Response, expectedRegexMsg string, args ...interface{})

func GenerateJwt

func GenerateJwt(strGen func(*Jwt) string, jwtSecret string, expiresIn time.Duration) string

func GenerateJwtWithName

func GenerateJwtWithName(strGen func(*Jwt) string, jwtSecret string, expiresIn time.Duration, name string) string

func GenerateJwtWithRsaSignature

func GenerateJwtWithRsaSignature(strGen func(*Jwt) string, rsaPrivateKey *rsa.PrivateKey, expiresIn time.Duration) string

func GenerateRsaPrivateKey

func GenerateRsaPrivateKey() *rsa.PrivateKey

func InvalidTokenStringHandler

func InvalidTokenStringHandler(j *Jwt) string

func SendGetRequest

func SendGetRequest(url string, headers map[string]string) *http.Response

func TokenStringHandler

func TokenStringHandler(j *Jwt) string

func WithBearer

func WithBearer(token string) string

Types

type Jwt

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

func NewJwt

func NewJwt(secret string) *Jwt

func NewRsaJwt

func NewRsaJwt(privKey *rsa.PrivateKey) *Jwt

func (*Jwt) WithExpiresAt

func (j *Jwt) WithExpiresAt(t time.Time) *Jwt

func (*Jwt) WithName

func (j *Jwt) WithName(name string) *Jwt

type TestServer

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

func NewTestServer

func NewTestServer(auth *middleware.Auth, enableLog bool) *TestServer

func (*TestServer) Context

func (ts *TestServer) Context() context.Context

func (*TestServer) EndpointUrl

func (ts *TestServer) EndpointUrl() string

func (*TestServer) StartInBackground

func (ts *TestServer) StartInBackground()

func (*TestServer) Stop

func (ts *TestServer) Stop()

Jump to

Keyboard shortcuts

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