testutils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientID       = "AZURE_CLIENT_ID"
	ClientSecret   = "AAD_SERVICE_PRINCIPAL_CLIENT_SECRET"
	ClientCert     = "AZURE_CLIENT_CER"
	ClientCertPass = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
	ResourceID     = "AZURE_RESOURCE_ID"
	TenantID       = "AZURE_TENANT_ID"
	BadSecret      = "Bad_Secret"
	Username       = "USERNAME"
	Password       = "PASSWORD"
)

Variables

This section is empty.

Functions

func ErrorContains

func ErrorContains(out error, want string) bool

ErrorContains takes an input error and a desired substring, checks if the string is present in the error message, and returns the boolean result

func GetVCRHttpClient

func GetVCRHttpClient(path string, token string) (*recorder.Recorder, *http.Client)

GetVCRHttpClient setup Go-vcr

func ReplaceSecretValuesIncludingURLEscaped added in v0.1.1

func ReplaceSecretValuesIncludingURLEscaped(body, secret, redactionToken string) string

ReplaceSecretValuesIncludingURLEscaped takes an input string, finds any instances of the input secret in the string (including in URL-escaped format), and replaces all instances with the given redaction token This is used for VCR tests as they sometimes include a URL-escaped version of the secret in the request body

Types

This section is empty.

Jump to

Keyboard shortcuts

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