fuzzAuthzPrep has same action and object types for all calls.
(t *testing.T, prep rbac.PreparedAuthorized, n int, action policy.Action, objectType string)
| 103 | |
| 104 | // fuzzAuthzPrep has same action and object types for all calls. |
| 105 | func fuzzAuthzPrep(t *testing.T, prep rbac.PreparedAuthorized, n int, action policy.Action, objectType string) []coderdtest.ActionObjectPair { |
| 106 | t.Helper() |
| 107 | pairs := make([]coderdtest.ActionObjectPair, 0, n) |
| 108 | |
| 109 | for i := 0; i < n; i++ { |
| 110 | obj := coderdtest.RandomRBACObject() |
| 111 | obj.Type = objectType |
| 112 | p := coderdtest.ActionObjectPair{Action: action, Object: obj} |
| 113 | _ = prep.Authorize(context.Background(), p.Object) |
| 114 | pairs = append(pairs, p) |
| 115 | } |
| 116 | return pairs |
| 117 | } |
| 118 | |
| 119 | func fuzzAuthz(t *testing.T, sub rbac.Subject, rec rbac.Authorizer, n int) []coderdtest.ActionObjectPair { |
| 120 | t.Helper() |
no test coverage detected