tester

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatJSON

func FormatJSON(description string, object interface{}) string

func FormatString

func FormatString(description string, msg string) string

func FormatYAML

func FormatYAML(description string, object interface{}) string

func GetDiagMessage

func GetDiagMessage(present bool, show bool, msg string) string

GetDiagMessage is helper function for preparing message set to be shown to user.

func Indent

func Indent(s string, padding int) string

Indent returns the string where each line is indented by the specified number of spaces.

Types

type AuthRequestInfo

type AuthRequestInfo struct {
	// Config holds *client.RedirectorConfig used for SSO redirect.
	Config *client.RedirectorConfig
	// RequestID is ID of auth request created for SSO test.
	RequestID string
	// RequestCreateErr holds an error in case auth request creation failed.
	RequestCreateErr error
}

AuthRequestInfo is helper type, useful for tying together test handlers of different auth types.

type SSOTestCommand

type SSOTestCommand struct {

	// Handlers is a mapping between auth kind and appropriate handling function
	Handlers map[string]func(c auth.ClientI, connBytes []byte) (*AuthRequestInfo, error)
	// GetDiagInfoFields provides auth kind-specific diagnostic info fields.
	GetDiagInfoFields map[string]func(diag *types.SSODiagnosticInfo, debug bool) []string
	// Browser to use in login flow.
	Browser string
	// contains filtered or unexported fields
}

SSOTestCommand implements common.CLICommand interface

func (*SSOTestCommand) Initialize

func (cmd *SSOTestCommand) Initialize(app *kingpin.Application, cfg *servicecfg.Config)

Initialize allows a caller-defined command to plug itself into CLI argument parsing

func (*SSOTestCommand) TryRun

func (cmd *SSOTestCommand) TryRun(ctx context.Context, selectedCommand string, c auth.ClientI) (match bool, err error)

TryRun is executed after the CLI parsing is done. The command must determine if selectedCommand belongs to it and return match=true

Jump to

Keyboard shortcuts

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