Request Limiter reloadable config (#25095)

This commit introduces a new reloadable stanza to the server config to allow disabling the Request Limiter.
This commit is contained in:
Mike Palmiotto
2024-01-26 15:01:47 -05:00
committed by GitHub
parent 43be9fc18a
commit 5933768ca5
8 changed files with 197 additions and 1 deletions

View File

@@ -1432,6 +1432,12 @@ func (c *ServerCommand) Run(args []string) int {
infoKeys = append(infoKeys, "administrative namespace")
info["administrative namespace"] = config.AdministrativeNamespacePath
infoKeys = append(infoKeys, "request limiter")
info["request limiter"] = "enabled"
if config.RequestLimiter != nil && config.RequestLimiter.Disable {
info["request limiter"] = "disabled"
}
sort.Strings(infoKeys)
c.UI.Output("==> Vault server configuration:\n")
@@ -1661,6 +1667,8 @@ func (c *ServerCommand) Run(args []string) int {
// Setting log request with the new value in the config after reload
core.ReloadLogRequestsLevel()
core.ReloadRequestLimiter()
// reloading HCP link
hcpLink, err = c.reloadHCPLink(hcpLink, config, core, hcpLogger)
if err != nil {
@@ -3095,6 +3103,10 @@ func createCoreConfig(c *ServerCommand, config *server.Config, backend physical.
AdministrativeNamespacePath: config.AdministrativeNamespacePath,
}
if config.RequestLimiter != nil {
coreConfig.DisableRequestLimiter = config.RequestLimiter.Disable
}
if c.flagDev {
coreConfig.EnableRaw = true
coreConfig.EnableIntrospection = true