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:
Aurélien Sibiril
2026-07-12 11:24:01 +02:00
parent 0b81393bdf
commit e648bc83fa

View File

@@ -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),