mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06:37 +00:00
Make 'URLPathTransformer' interface and implementation to do the function prefix trimming instead of baking it in. Also add a configuration option, 'pass_url_path_to_functions' to control whether the full path is passed to the functions or not.
Signed-off-by: Thomas E Lackey <telackey@bozemanpass.com>
This commit is contained in:
committed by
Alex Ellis
parent
7870b87c38
commit
decf9addb3
@ -105,6 +105,8 @@ func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig {
|
||||
cfg.DirectFunctions = parseBoolValue(hasEnv.Getenv("direct_functions"))
|
||||
cfg.DirectFunctionsSuffix = hasEnv.Getenv("direct_functions_suffix")
|
||||
|
||||
cfg.PassURLPathsToFunctions = parseBoolValue(hasEnv.Getenv("pass_url_path_to_functions"))
|
||||
|
||||
cfg.UseBasicAuth = parseBoolValue(hasEnv.Getenv("basic_auth"))
|
||||
|
||||
secretPath := hasEnv.Getenv("secret_mount_path")
|
||||
@ -150,6 +152,10 @@ type GatewayConfig struct {
|
||||
// If set this will be used to resolve functions directly
|
||||
DirectFunctionsSuffix string
|
||||
|
||||
// If set to true, the requested path will be passed along to the function, minus the "/function/xyz"
|
||||
// prefix, else the path will be truncated to "/" regardless of what the client sends.
|
||||
PassURLPathsToFunctions bool
|
||||
|
||||
// If set, reads secrets from file-system for enabling basic auth.
|
||||
UseBasicAuth bool
|
||||
|
||||
|
Reference in New Issue
Block a user