Strip the Dotfile API key header when recording cassettes
The shared VCR BeforeSave hook scrubs every other header-auth provider's key (X-Api-Key, Api-Key, Signoz-Api-Key, X-Auth-Token) but was not updated for Dotfile, so re-recording testdata/dotfile.yaml with a real X-DOTFILE-API-KEY would persist the key into the committed cassette. Delete the canonicalized X-Dotfile-Api-Key header alongside the others. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -66,6 +66,9 @@ func newRecorder(t *testing.T, cassettePath string, envVar string) *recorder.Rec
|
||||
i.Request.Headers.Del("Api-Key")
|
||||
// Scaleway authenticates with the secret key in X-Auth-Token.
|
||||
i.Request.Headers.Del("X-Auth-Token")
|
||||
// Dotfile authenticates with the key in X-DOTFILE-API-KEY
|
||||
// (canonicalized to X-Dotfile-Api-Key).
|
||||
i.Request.Headers.Del("X-Dotfile-Api-Key")
|
||||
|
||||
return nil
|
||||
}, recorder.BeforeSaveHook),
|
||||
|
||||
Reference in New Issue
Block a user