Documentation
¶
Overview ¶
Package authheaders contains helpers for stamping the request-header identity headers (X-Remote-User / X-Remote-Group / X-Remote-Extra-*) that kcp proxies use to forward an authenticated identity to a backend shard or virtual workspace. The backend trusts these headers verbatim over the proxy's mutually-authenticated connection, so the stamping must always strip any client-supplied copies first.
Index ¶
Constants ¶
const ( DefaultUserHeader = "X-Remote-User" DefaultGroupHeader = "X-Remote-Group" DefaultExtraHeaderPrefix = "X-Remote-Extra-" // front-proxy doesn't stamp uid header, only strips it // The uid header is informational but webhooks can receive it and // make decisions on it. DefaultUIDHeader = "X-Remote-Uid" )
The header names a backend is conventionally configured to trust, matching the --requestheader-username-headers, --requestheader-group-headers and --requestheader-extra-headers-prefix that kcp starts its shards and virtual workspace servers with.
Variables ¶
This section is empty.
Functions ¶
func ClearAuthHeaders ¶ added in v0.31.4
ClearAuthHeaders deletes any inbound copies of the request-header identity headers.
func SetAuthHeaders ¶
func SetAuthHeaders(header http.Header, user userinfo.Info, userHeader, groupHeader, extraHeaderPrefix string)
SetAuthHeaders stamps the given authenticated user's identity onto the request headers, after deleting any inbound copies of the identity headers.
This mirrors k8s.io/client-go/transport.SetAuthProxyHeaders and the upstream requestheader authenticator's ClearAuthenticationHeaders.
Types ¶
This section is empty.