Propagate context to Authorize() calls
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package abac
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
@@ -133,7 +134,7 @@ func TestAuthorizeV0(t *testing.T) {
|
||||
|
||||
ResourceRequest: len(tc.NS) > 0 || len(tc.Resource) > 0,
|
||||
}
|
||||
decision, _, _ := a.Authorize(attr)
|
||||
decision, _, _ := a.Authorize(context.Background(), attr)
|
||||
if tc.ExpectDecision != decision {
|
||||
t.Logf("tc: %v -> attr %v", tc, attr)
|
||||
t.Errorf("%d: Expected allowed=%v but actually allowed=%v\n\t%v",
|
||||
@@ -451,7 +452,7 @@ func TestAuthorizeV1beta1(t *testing.T) {
|
||||
Path: tc.Path,
|
||||
}
|
||||
// t.Logf("tc %2v: %v -> attr %v", i, tc, attr)
|
||||
decision, _, _ := a.Authorize(attr)
|
||||
decision, _, _ := a.Authorize(context.Background(), attr)
|
||||
if tc.ExpectDecision != decision {
|
||||
t.Errorf("%d: Expected allowed=%v but actually allowed=%v, for case %+v & %+v",
|
||||
i, tc.ExpectDecision, decision, tc, attr)
|
||||
|
Reference in New Issue
Block a user