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
|
|
@ -49,6 +49,15 @@ func TestCheckUsesExplicitCaringContext(t *testing.T) {
|
|||
if got.Resource.Type != "document" || got.Resource.Attributes["trust_zone"] != "internal" {
|
||||
t.Errorf("got.Resource = %+v; want enriched document resource", got.Resource)
|
||||
}
|
||||
if got.Binding == nil {
|
||||
t.Fatal("got.Binding is nil")
|
||||
}
|
||||
if got.Binding.Action != request.Action || got.Binding.Subject.ID != got.Subject.ID || got.Binding.Resource.ID != got.Resource.ID {
|
||||
t.Errorf("got.Binding = %+v; want normalized action, subject, and resource", got.Binding)
|
||||
}
|
||||
if !strings.HasPrefix(got.Binding.RequestDigest, "sha256:") || len(got.Binding.RequestDigest) != len("sha256:")+64 {
|
||||
t.Errorf("got.Binding.RequestDigest = %q; want full SHA-256 digest", got.Binding.RequestDigest)
|
||||
}
|
||||
if got.Caring == nil || got.Caring.Descriptor == nil {
|
||||
t.Fatal("got.Caring.Descriptor is nil")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue