feat(authz): bind decisions to exact actions
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a02e47-6aac-7ee1-914d-0584c75d3c81
This commit is contained in:
parent
7323dd1a60
commit
c473f1971d
28 changed files with 644 additions and 12 deletions
|
|
@ -93,6 +93,20 @@ func TestDecisionAndAuditExamplesParse(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestActionAuthorizationExampleParses(t *testing.T) {
|
||||
var authorization api.ActionAuthorization
|
||||
loadJSON(t, filepath.Join("..", "..", "examples", "caring", "action_authorization.json"), &authorization)
|
||||
if authorization.Status != api.ActionAuthorizationApproved {
|
||||
t.Fatalf("Status = %q; want approved", authorization.Status)
|
||||
}
|
||||
if authorization.Request.Action != "destroy" || authorization.Decision.Binding == nil {
|
||||
t.Fatalf("authorization is not action-bound: %+v", authorization)
|
||||
}
|
||||
if authorization.Approvals.RequiredCount != 2 || len(authorization.Approvals.Entries) != 2 {
|
||||
t.Fatalf("Approvals = %+v; want two-person approval", authorization.Approvals)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSchemaFilesAreJSON(t *testing.T) {
|
||||
schemaDir := filepath.Join("..", "..", "schemas")
|
||||
entries, err := os.ReadDir(schemaDir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue