Commit Graph

7 Commits

Author SHA1 Message Date
Jordan Liggitt 5558d0c5ce Make the request attributes clearer in forbidden messages
Kubernetes-commit: 4e0a3b557e235ad354f6dfb4567d2a20ebde403a
2018-08-09 15:51:52 -04:00
Clayton Coleman 089e209aad Guarantee that status errors have a kind set
Some errors are invoked outside of negotiation. These errors should
still have a kind and apiVersion (which is only set by structured
encoders, not always availabe). Ensure that all errors by default get a
status kind and version set.

Kubernetes-commit: a1e44fc69bf0faeb47e6d2ebfc2709bbc3f17221
2017-11-15 21:02:34 -05:00
Di Xu e69ddb7b01 fix format of forbidden messages
Kubernetes-commit: 95738d5a0eeb179325858e52ff83ff86de6fce0b
2017-09-09 21:44:31 +00:00
Cao Shufeng 892932fb62 Fix forbidden message format
Before this change:
 # kubectl get pods --as=tom
 Error from server (Forbidden): pods "" is forbidden: User "tom" cannot list pods in the namespace "default".
After this change:
 # kubectl get pods --as=tom
 Error from server (Forbidden): pods is forbidden: User "tom" cannot list pods in the namespace "default".

Kubernetes-commit: ab0918673728fc50fc539017c86bbc03fceb0adc
2017-08-29 13:18:50 +00:00
Cao Shufeng 6040aeb60d Fix invalid Content-Type for 403 error
https://github.com/kubernetes/kubernetes/pull/47384 makes 403 errors
return Status Object. How the Content-Type is still "text/plain"
This change fix it.

Kubernetes-commit: 36e0a5ed14ae0fb9fd88980f0fce57d076216e2e
2017-07-06 23:56:07 +00:00
Shiyang Wang 276c240fae Fix 401/403 apiserver errors do not return 'Status' objects
Kubernetes-commit: 3d6479f7216dcb61e56ab6dd53fad7176930645d
2017-07-05 23:59:23 +00:00
Ryan Hitchman 4e16eae82b Escape "<>&" in apiserver errors to avoid triggering vulnerability scanners.
Simple XSS scans might fetch /<script>alert('vulnerable')</script>, and
fail when the response body includes the script tag verbatim, despite
the headers directing the browser to interpret the response as text.

This isn't a real vulnerability, but it's easier to fix this here than
it is to fix the scanners.

Kubernetes-commit: dd4bb1213d8447632fa651195980cbfae2546fb3
2017-05-12 17:30:09 +00:00