package
0.2.0-g958cdc2
Repository: https://github.com/copilotiq/opa-tests.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

Generate all the test cases from the `SourceDir`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

A BundleManifest describes the `Bundle` to the OPA server We only use it for informational purposes during tests execution.
A JwtBody describes the contents ("claims") that will be included in the JSON body, and that will be part of the OPA Request: the Token (encoded as a JWT) describes the Subject ( "sub") who acts as the original sender of the request, who has been assigned a number of Roles.
A Request is what is typically sent from a REST API server that requires the user (authenticated by the `Token`) to be authorized to access the `Resource`.
A Resource describes the access request from the test users ( the "sub") as the tuple of a Method (the action on the resource) and the Path ( the actual entity being accessed).
Target defines the policy that we want to test with the Testcase and will be ultimately used to construct the OPA endpoint to use for the Test.
A Test is a single assertion made against the Rego policies, with an expectation of success or failure ( depending on whether we are testing an `allow` or `deny` scenario).
A TestBody is the JSON that will be sent to OPA to evaluate the Policy.
A Testcase is the central part of the application: it describes a coherent set of `Tests` that will be evaluated against the deployed `Bundle` of policies The `expect` outcome will be validated once the tests are executed, against the actual result returned by the OPA server.
A TestcaseTemplate is the contents of a YAML ( or a section thereof) and contains the full description of a `Testcase` that will be generated.
TestReport will collect and report all test results, including failures TODO: need a much better reporting.
The TestUnit is the culmination of the test generation, and is the unit that is evaluated by each of the workers, run in parallel as goroutines.