You've already forked oauth2-proxy
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:
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user