1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-19 23:52:17 +02:00

fix: regex substitution for $ signs in upstream path handling before running envsubst (#2524)

* Perform a regex replace of $NUM to $$NUM before running envsubst

* Perform a regex replace of $NUM to $$NUM before running envsubst

* add test case; fix linter warnings; add method documentation

Signed-off-by: Jan Larwig <jan@larwig.com>

* add changelog entry

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Ashkan Daie
2025-07-21 23:52:23 -07:00
committed by GitHub
parent a88306be98
commit 137e59d526
3 changed files with 46 additions and 4 deletions

View File

@@ -487,6 +487,31 @@ sub:
StringOption: "Bob",
},
}),
Entry("with a config file containing $ signs for things other than environment variables", loadYAMLTableInput{
configFile: []byte(`
stringOption: /$1
stringSliceOption:
- /$1
- ^/(.*)$
- api/$1
- api/(.*)$
- ^/api/(.*)$
- /api/$1`),
input: &TestOptions{},
expectedOutput: &TestOptions{
StringOption: "/$1",
TestOptionSubStruct: TestOptionSubStruct{
StringSliceOption: []string{
"/$1",
"^/(.*)$",
"api/$1",
"api/(.*)$",
"^/api/(.*)$",
"/api/$1",
},
},
},
}),
)
})