description
The CLI currently implements functionality that is useful outside a command-line process, but the reusable pieces live under internal and are not consumable by external Go applications.
We would like to programmatically use the equivalent of fga model test, given an in-memory struct matching the documented .fga.yaml test file format, execute the tests and return structured results/summary.
example
func main() {
result, err := modeltest.Run(ctx, modeltest.StoreData{
Model: "...",
Tuples: []client.ClientContextualTupleKey{...},
Tests: []modeltest.ModelTest{...},
}, modeltest.WithMaxTypesPerAuthorizationModel(100))
if result.Summary.Passing {
// ...
}
}
description
The CLI currently implements functionality that is useful outside a command-line process, but the reusable pieces live under
internaland are not consumable by external Go applications.We would like to programmatically use the equivalent of
fga model test, given an in-memory struct matching the documented.fga.yamltest file format, execute the tests and return structured results/summary.example