diff --git a/pkg/authorization/authorizer/interfaces.go b/pkg/authorization/authorizer/interfaces.go index ce70710fa..2a826981c 100644 --- a/pkg/authorization/authorizer/interfaces.go +++ b/pkg/authorization/authorizer/interfaces.go @@ -71,10 +71,10 @@ type Authorizer interface { Authorize(ctx context.Context, a Attributes) (authorized Decision, reason string, err error) } -type AuthorizerFunc func(a Attributes) (Decision, string, error) +type AuthorizerFunc func(ctx context.Context, a Attributes) (Decision, string, error) func (f AuthorizerFunc) Authorize(ctx context.Context, a Attributes) (Decision, string, error) { - return f(a) + return f(ctx, a) } // RuleResolver provides a mechanism for resolving the list of rules that apply to a given user within a namespace. diff --git a/pkg/authorization/path/path.go b/pkg/authorization/path/path.go index 03f524b38..0e1ec2338 100644 --- a/pkg/authorization/path/path.go +++ b/pkg/authorization/path/path.go @@ -17,6 +17,7 @@ limitations under the License. package path import ( + "context" "fmt" "strings" @@ -46,7 +47,7 @@ func NewAuthorizer(alwaysAllowPaths []string) (authorizer.Authorizer, error) { } } - return authorizer.AuthorizerFunc(func(a authorizer.Attributes) (authorizer.Decision, string, error) { + return authorizer.AuthorizerFunc(func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) { if a.IsResourceRequest() { return authorizer.DecisionNoOpinion, "", nil }