From 8b28f6a167388e74dc71c7a20d0714a78ede2b14 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Fri, 3 Mar 2023 16:47:40 +0100 Subject: [PATCH] Pass request verb correctly seems to be only sometimes in request info. (#118) Would need more debugging --- apiserver/authwrapper/storage.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apiserver/authwrapper/storage.go b/apiserver/authwrapper/storage.go index df82fcd4..d32ce132 100644 --- a/apiserver/authwrapper/storage.go +++ b/apiserver/authwrapper/storage.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/http" + "strings" apierrors "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" @@ -255,7 +256,7 @@ func (s *authorizedStorage) NewConnectOptions() (runtime.Object, bool, string) { func (s *authorizedStorage) Connect(ctx context.Context, name string, options runtime.Object, responder rest.Responder) (http.Handler, error) { if c, ok := s.storage.(rest.Connecter); ok { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - if err := s.authorizer.AuthorizeContext(ctx); err != nil { + if err := s.authorizer.AuthorizeVerb(ctx, strings.ToLower(req.Method), name); err != nil { responder.Error(err) return }