softimpersonation

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package softimpersonation implements "Soft impersonation", which allows carrying the whole description of the user an action is done for, without really impersonating this user and thus impacting the authorizations on the KCP side.

This is particularly useful in virtual workspaces which are connected to KCP as privileged user, but act on behalf of a user, for example when crating a workspace through the `workspaces` virtual workspace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserInfoFromRequestHeader

func UserInfoFromRequestHeader(r *http.Request) (kuser.Info, error)

UserInfoFromRequestHeader extract a user.Info object from an internal request header set by a softly impersonated client.

func WithSoftImpersonatedConfig

func WithSoftImpersonatedConfig(config *rest.Config, userInfo kuser.Info) (*rest.Config, error)

WithSoftImpersonatedConfig returns a clone of the input rest.Config with an additional header containing the given user info marshalled in Json.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL