Fix bug which prevented watches from working through impersonator

Also:
- Changed base64 encoding of impersonator bearer tokens to use
  `base64.StdEncoding` to make it easier for users to manually
  create a token using the unix `base64` command
- Test the headers which are and are not passed through to the Kube API
  by the impersonator more carefully in the unit tests
- More WIP on concierge_impersonation_proxy_test.go

Signed-off-by: Margo Crawford <margaretc@vmware.com>
This commit is contained in:
Ryan Richard
2021-02-22 17:23:11 -08:00
committed by Margo Crawford
parent b8592a361c
commit 80ff5c1f17
9 changed files with 250 additions and 88 deletions
+1 -1
View File
@@ -294,7 +294,7 @@ func execCredentialForImpersonationProxy(
if err != nil {
return nil, fmt.Errorf("Error creating TokenCredentialRequest for impersonation proxy: %w", err)
}
encodedToken := base64.RawURLEncoding.EncodeToString(reqJSON)
encodedToken := base64.StdEncoding.EncodeToString(reqJSON)
cred := &clientauthv1beta1.ExecCredential{
TypeMeta: metav1.TypeMeta{
Kind: "ExecCredential",
+1 -1
View File
@@ -288,5 +288,5 @@ func impersonationProxyTestToken(token string) string {
},
},
})
return base64.RawURLEncoding.EncodeToString(reqJSON)
return base64.StdEncoding.EncodeToString(reqJSON)
}