mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-02 23:55:18 +00:00
Introduces Impersonate-Uid to client-go.
* Updates ImpersonationConfig in rest/config.go to include UID attribute, and pass it through when copying the config * Updates ImpersonationConfig in transport/config.go to include UID attribute * In transport/round_tripper.go, Set the "Impersonate-Uid" header in requests based on the UID value in the config * Update auth_test.go integration test to specify a UID through the new rest.ImpersonationConfig field rather than manually setting the Impersonate-Uid header Signed-off-by: Margo Crawford <margaretc@vmware.com> Kubernetes-commit: d9ddfb26e10ee353fc4617b66d2c9274bf6d1c08
This commit is contained in:
committed by
Kubernetes Publisher
parent
7cbd2d5c7a
commit
e0129e64d4
@@ -202,6 +202,8 @@ func (c *Config) String() string {
|
||||
type ImpersonationConfig struct {
|
||||
// UserName is the username to impersonate on each request.
|
||||
UserName string
|
||||
// UID is a unique value that identifies the user.
|
||||
UID string
|
||||
// Groups are the groups to impersonate on each request.
|
||||
Groups []string
|
||||
// Extra is a free-form field which can be used to link some authentication information
|
||||
@@ -608,9 +610,10 @@ func CopyConfig(config *Config) *Config {
|
||||
BearerToken: config.BearerToken,
|
||||
BearerTokenFile: config.BearerTokenFile,
|
||||
Impersonate: ImpersonationConfig{
|
||||
UserName: config.Impersonate.UserName,
|
||||
UID: config.Impersonate.UID,
|
||||
Groups: config.Impersonate.Groups,
|
||||
Extra: config.Impersonate.Extra,
|
||||
UserName: config.Impersonate.UserName,
|
||||
},
|
||||
AuthProvider: config.AuthProvider,
|
||||
AuthConfigPersister: config.AuthConfigPersister,
|
||||
|
Reference in New Issue
Block a user