Fix: Prevent ExtSvcTokens from containing nil characters (#88243)

* Fix: Prevent ExtSvcTokens from containing nil characters

* Rebase

* Add more logs

* Nit. nil -> NUL

* Nit. Part -> Parts

* Back to const

* Account for comments

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>

---------

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>
This commit is contained in:
Gabriel MABILLE
2024-05-28 10:39:46 +02:00
committed by GitHub
co-authored by Claudiu Dragalina-Paraipan
parent f6a83432a5
commit 3d9908f363
3 changed files with 62 additions and 9 deletions
@@ -179,7 +179,7 @@ func (p *EnvVarsProvider) pluginSettingsEnvVars(pluginID string) []string {
func (p *EnvVarsProvider) envVar(key, value string) string {
if strings.Contains(value, "\x00") {
p.logger.Error("Variable with key '%s' contains a nil character", key)
p.logger.Error("Variable with key '%s' contains NUL", key)
}
return fmt.Sprintf("%s=%s", key, value)
}