Documentation ¶
Index ¶
- func AssetAcmeDBFilePath() string
- func AssetDefaultConfigLocal() config.Path
- func AssetDefaultConfigOnline() config.Path
- func AssetLocalBundle() string
- func AssetsDir() string
- func LogReadLine(reader *bufio.Reader, timeout time.Duration) (string, error)
- func PortOpen(listenAddress string) bool
- func PrettyPrintObject(obj interface{}) string
- type DirectoryClient
- type EngineHarness
- func (h *EngineHarness) Cleanup()
- func (h *EngineHarness) Context() context.Context
- func (h *EngineHarness) CreateClient() *http.Client
- func (h *EngineHarness) CreateDirectoryClient(ctx context.Context) *DirectoryClient
- func (h *EngineHarness) CreateGRPCClient() authz2.AuthorizerClient
- func (h *EngineHarness) Req(verb, path, tenantID, body string) (string, int)
- type LogDebugger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetAcmeDBFilePath ¶ added in v0.30.0
func AssetAcmeDBFilePath() string
AssetAcmeDBFilePath returns the path of the test contoso EDS database file.
func AssetDefaultConfigLocal ¶
AssetDefaultConfigLocal returns the path of the default yaml config file that doesn't use an online bundle.
func AssetDefaultConfigOnline ¶
AssetDefaultConfigOnline returns the path of the default yaml config file that uses an online bundle.
func AssetLocalBundle ¶
func AssetLocalBundle() string
AssetLocalBundle returns the path of the default local bundle directory that contains test policies and data.
func AssetsDir ¶
func AssetsDir() string
AssetsDir returns the directory containing test assets nolint: dogsled
func LogReadLine ¶
LogReadLine reads and returns a single line from the given file. If a given timeout has passed, an error is returned.
func PrettyPrintObject ¶
func PrettyPrintObject(obj interface{}) string
PrettyPrintObject returns the JSON representation of any object; only useful for debugging.
Types ¶
type DirectoryClient ¶ added in v0.30.0
type DirectoryClient struct { Model dsm3.ModelClient Reader dsr3.ReaderClient Writer dsw3.WriterClient Importer dsi3.ImporterClient Exporter dse3.ExporterClient }
type EngineHarness ¶
type EngineHarness struct { Engine *app.Topaz LogDebugger *LogDebugger // contains filtered or unexported fields }
EngineHarness wraps an Aserto Runtime Engine so we can set it up easily and monitor its logs.
func SetupOffline ¶
func SetupOffline(t *testing.T, configOverrides func(*config.Config)) *EngineHarness
SetupOffline sets up an engine that uses a runtime that loads offline bundles, from the assets directory.
func SetupOnline ¶
func SetupOnline(t *testing.T, configOverrides func(*config.Config)) *EngineHarness
SetupOnline sets up an engine that uses a runtime that loads online bundles, from the online policy registry service.
func (*EngineHarness) Cleanup ¶
func (h *EngineHarness) Cleanup()
Cleanup releases all resources the harness uses and shuts down servers and runtimes.
func (*EngineHarness) Context ¶ added in v0.0.8
func (h *EngineHarness) Context() context.Context
func (*EngineHarness) CreateClient ¶
func (h *EngineHarness) CreateClient() *http.Client
CreateClient creates a new http client that can talk to the API.
func (*EngineHarness) CreateDirectoryClient ¶ added in v0.30.0
func (h *EngineHarness) CreateDirectoryClient(ctx context.Context) *DirectoryClient
func (*EngineHarness) CreateGRPCClient ¶
func (h *EngineHarness) CreateGRPCClient() authz2.AuthorizerClient
type LogDebugger ¶ added in v0.0.7
type LogDebugger struct {
// contains filtered or unexported fields
}
func NewLogDebugger ¶ added in v0.0.7
func NewLogDebugger(t *testing.T, logName string) *LogDebugger
func (*LogDebugger) Contains ¶ added in v0.0.7
func (d *LogDebugger) Contains(message string) bool