mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Revert "limit forbidden error to details of what was forbidden"
This reverts commit ecbd013795.
			
			
This commit is contained in:
		@@ -73,7 +73,7 @@ func WithAuthorization(handler http.Handler, a authorizer.Authorizer, s runtime.
 | 
			
		||||
		glog.V(4).Infof("Forbidden: %#v, Reason: %q", req.RequestURI, reason)
 | 
			
		||||
		audit.LogAnnotation(ae, decisionAnnotationKey, decisionForbid)
 | 
			
		||||
		audit.LogAnnotation(ae, reasonAnnotationKey, reason)
 | 
			
		||||
		responsewriters.Forbidden(ctx, attributes, w, req, "", s)
 | 
			
		||||
		responsewriters.Forbidden(ctx, attributes, w, req, reason, s)
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ func WithImpersonation(handler http.Handler, a authorizer.Authorizer, s runtime.
 | 
			
		||||
			decision, reason, err := a.Authorize(actingAsAttributes)
 | 
			
		||||
			if err != nil || decision != authorizer.DecisionAllow {
 | 
			
		||||
				glog.V(4).Infof("Forbidden: %#v, Reason: %s, Error: %v", req.RequestURI, reason, err)
 | 
			
		||||
				responsewriters.Forbidden(ctx, actingAsAttributes, w, req, "", s)
 | 
			
		||||
				responsewriters.Forbidden(ctx, actingAsAttributes, w, req, reason, s)
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -175,7 +175,7 @@ func TestStatus(t *testing.T) {
 | 
			
		||||
			statusCode:   http.StatusForbidden,
 | 
			
		||||
			reqPath:      "/apis",
 | 
			
		||||
			reason:       "Forbidden",
 | 
			
		||||
			message:      `forbidden: User "" cannot get path "/apis"`,
 | 
			
		||||
			message:      `forbidden: User "" cannot get path "/apis": Everything is forbidden.`,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			name:         "401",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user