cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvironmentNameRegex      = `[a-z0-9\-_]+`
	EnvironmentTypeProduction = "Production"
	EnvironmentTypeSandbox    = "Sandbox"
	FlagEndpoint              = "endpoint"
)
View Source
const (
	ResourceSeparator = ":"
	RelationSeparator = "#"

	TestFileExtensionJSON = ".test.json"
	TestFileExtensionYAML = ".test.yaml"
	TestFileExtensionYML  = ".test.yml"
)
View Source
const (
	FlagDomain = "domain"
)

Variables

View Source
var AcceptedTestFileExtensionErrorMessage = fmt.Sprintf("Accepted test file extensions are: %s", strings.Join(AcceptedTestFileExtensions, ", "))

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetConfigOrExit

func GetConfigOrExit() *config.Config

func SetVersion

func SetVersion(version string)

Types

type FGATestCase added in v0.5.0

type FGATestCase struct {
	Name   string       `yaml:"name" json:"name"`
	Check  FGATestCheck `yaml:"check" json:"check"`
	Expect bool         `yaml:"expect" json:"expect"`
}

type FGATestCheck added in v0.5.0

type FGATestCheck struct {
	Subject  string                 `yaml:"subject" json:"subject"`
	Relation string                 `yaml:"relation" json:"relation"`
	Resource string                 `yaml:"resource" json:"resource"`
	Context  map[string]interface{} `yaml:"context,omitempty" json:"context,omitempty"`
}

type FGATestResult added in v0.5.0

type FGATestResult struct {
	Passed    bool
	NumPassed int
	NumTotal  int
}

type FGATestSetupSection added in v0.5.0

type FGATestSetupSection struct {
	Warrants []WarrantSetup `yaml:"warrants" json:"warrants"`
}

type FGATestTeardownSection added in v0.5.0

type FGATestTeardownSection struct {
	Warrants  []WarrantSetup `yaml:"warrants" json:"warrants"`
	Resources []string       `yaml:"resources" json:"resources"`
}

type FGATestYaml added in v0.5.0

type FGATestYaml struct {
	Setup    FGATestSetupSection     `yaml:"setup" json:"setup"`
	Tests    []FGATestCase           `yaml:"tests" json:"tests"`
	Teardown *FGATestTeardownSection `yaml:"teardown,omitempty" json:"teardown,omitempty"`
}

type WarrantSetup added in v0.5.0

type WarrantSetup struct {
	Subject  string `yaml:"subject" json:"subject"`
	Relation string `yaml:"relation" json:"relation"`
	Resource string `yaml:"resource" json:"resource"`
	Policy   string `yaml:"policy,omitempty" json:"policy,omitempty"`
}

Jump to

Keyboard shortcuts

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