Documentation ¶
Index ¶
- Constants
- Variables
- func GetBool(msg *structpb.Struct, fieldName string) (bool, bool)
- func GetString(msg *structpb.Struct, fieldName string) (string, bool)
- func PrintDesc(descFlag, description string, result *CheckResult, expected bool)
- func PromptYesNo(label string, def bool) bool
- func UnmarshalReq(value *structpb.Value, msg proto.Message) error
- type CheckResult
- type CheckType
- type SaveContext
- type TestExecCmd
- type TestResults
- func (t *TestResults) Errored() int32
- func (t *TestResults) Failed() int32
- func (t *TestResults) IncrErrored()
- func (t *TestResults) IncrFailed()
- func (t *TestResults) IncrPassed()
- func (t *TestResults) IncrSkipped()
- func (t *TestResults) IncrTotal()
- func (t *TestResults) Passed(passed bool)
- func (t *TestResults) PrintSummary(w io.Writer)
- type TestRunner
- func NewAuthorizerTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, azConfig *azc.Config) (*TestRunner, error)
- func NewDirectoryTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, dsConfig *dsc.Config) (*TestRunner, error)
- func NewTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, azConfig *azc.Config, dsConfig *dsc.Config) (*TestRunner, error)
Constants ¶
View Source
const ( TestOutputTable string = "table" TestOutputCSV string = "csv" Expected string = "expected" Description string = "description" DescOff string = "off" DescOn string = "on" DescOnError string = "on-error" Passed string = "PASS" Failed string = "FAIL" Errored string = "ERR " )
View Source
const ( CheckStr string = "check" CheckRelationStr string = "check_relation" CheckPermissionStr string = "check_permission" CheckDecisionStr string = "check_decision" )
View Source
const (
CLIConfigurationFile = "topaz.json"
)
Variables ¶
View Source
var ( ErrSkippedAuthorizerAssertion = cerr.NewAsertoError("T10001", codes.Internal, http.StatusInternalServerError, "no authorizer client") ErrSkippedDirectoryAssertion = cerr.NewAsertoError("T10002", codes.Internal, http.StatusInternalServerError, "no directory client") )
View Source
var CheckTypeMap = map[string]CheckType{ CheckStr: Check, CheckRelationStr: CheckRelation, CheckPermissionStr: CheckPermission, CheckDecisionStr: CheckDecision, }
View Source
var CheckTypeMapStr = map[CheckType]string{ Check: CheckStr, CheckRelation: CheckRelationStr, CheckPermission: CheckPermissionStr, CheckDecision: CheckDecisionStr, }
Functions ¶
func PrintDesc ¶ added in v0.32.27
func PrintDesc(descFlag, description string, result *CheckResult, expected bool)
func PromptYesNo ¶
Types ¶
type CheckResult ¶ added in v0.32.27
func (*CheckResult) PrintCSVHeader ¶ added in v0.32.27
func (cr *CheckResult) PrintCSVHeader(w *csv.Writer)
func (*CheckResult) PrintTable ¶ added in v0.32.27
type SaveContext ¶
type SaveContext bool
var ( Save SaveContext RestrictedNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9_.-]*$`) )
type TestExecCmd ¶ added in v0.32.27
type TestExecCmd struct { Files []string `arg:"" default:"assertions.json" help:"path to assertions file" sep:"none" optional:""` Stdin bool `flag:"" default:"false" help:"read assertions from --stdin"` Summary bool `flag:"" default:"false" help:"display test summary"` Format string `flag:"" default:"table" help:"output format (table|csv)" enum:"table,csv"` Desc string `flag:"" default:"off" enum:"off,on,on-error" help:"output descriptions (off|on|on-error)"` }
type TestResults ¶ added in v0.32.27
type TestResults struct {
// contains filtered or unexported fields
}
func NewTestResults ¶ added in v0.32.27
func NewTestResults(assertions []json.RawMessage) *TestResults
func (*TestResults) Errored ¶ added in v0.32.27
func (t *TestResults) Errored() int32
func (*TestResults) Failed ¶ added in v0.32.27
func (t *TestResults) Failed() int32
func (*TestResults) IncrErrored ¶ added in v0.32.27
func (t *TestResults) IncrErrored()
func (*TestResults) IncrFailed ¶ added in v0.32.27
func (t *TestResults) IncrFailed()
func (*TestResults) IncrPassed ¶ added in v0.32.27
func (t *TestResults) IncrPassed()
func (*TestResults) IncrSkipped ¶ added in v0.32.27
func (t *TestResults) IncrSkipped()
func (*TestResults) IncrTotal ¶ added in v0.32.27
func (t *TestResults) IncrTotal()
func (*TestResults) Passed ¶ added in v0.32.27
func (t *TestResults) Passed(passed bool)
func (*TestResults) PrintSummary ¶ added in v0.32.27
func (t *TestResults) PrintSummary(w io.Writer)
type TestRunner ¶ added in v0.32.27
type TestRunner struct {
// contains filtered or unexported fields
}
func NewAuthorizerTestRunner ¶ added in v0.32.27
func NewAuthorizerTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, azConfig *azc.Config) (*TestRunner, error)
func NewDirectoryTestRunner ¶ added in v0.32.27
func NewDirectoryTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, dsConfig *dsc.Config) (*TestRunner, error)
func NewTestRunner ¶ added in v0.32.27
func NewTestRunner(c *cc.CommonCtx, cmd *TestExecCmd, azConfig *azc.Config, dsConfig *dsc.Config) (*TestRunner, error)
Click to show internal directories.
Click to hide internal directories.