Skip to content

Commit

Permalink
chore: Add output support to Playground API (#1632)
Browse files Browse the repository at this point in the history
Refactor the `PlaygroundEvaluateResponse` message to avoid repetition of
`effectiveDerivedRoles` and `validationErrors`.

Add `outputs` to the evaluate response.

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
  • Loading branch information
charithe committed Jun 8, 2023
1 parent 5925445 commit c823d98
Show file tree
Hide file tree
Showing 17 changed files with 731 additions and 185 deletions.
28 changes: 28 additions & 0 deletions api/genpb/cerbos/private/v1/hashpb_helpers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions api/genpb/cerbos/response/v1/hashpb_helpers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

349 changes: 196 additions & 153 deletions api/genpb/cerbos/response/v1/response.pb.go

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions api/genpb/cerbos/response/v1/response.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

203 changes: 203 additions & 0 deletions api/genpb/cerbos/response/v1/response_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions api/public/cerbos/response/v1/response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,15 @@ message PlaygroundEvaluateResponse {
string action = 1;
cerbos.effect.v1.Effect effect = 2;
string policy = 3;
repeated string effective_derived_roles = 4;
repeated cerbos.schema.v1.ValidationError validation_errors = 5;
repeated string effective_derived_roles = 4 [deprecated = true];
repeated cerbos.schema.v1.ValidationError validation_errors = 5 [deprecated = true];
}

message EvalResultList {
repeated EvalResult results = 1;
repeated string effective_derived_roles = 2;
repeated cerbos.schema.v1.ValidationError validation_errors = 3;
repeated cerbos.engine.v1.OutputEntry outputs = 4;
}

string playground_id = 1;
Expand Down

0 comments on commit c823d98

Please sign in to comment.