Fix TestProxy_Cache_EventSystemUpdatesCacheKVV2 (#26352)

* Fix TestProxy_Cache_EventSystemUpdatesCacheKVV2

* Edited tests, and added a new bool

* Edited tests

* Edited comment

* Rename argument in handler method

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
This commit is contained in:
divyaac
2024-04-11 07:17:04 -07:00
committed by GitHub
parent c96c1efcea
commit e5fc11227d
6 changed files with 17 additions and 13 deletions

View File

@@ -627,16 +627,18 @@ func (c *ProxyCommand) Run(args []string) int {
Logger: apiProxyLogger,
Sink: inmemSink,
})
useAutoAuthToken := false
proxyVaultToken := true
if config.APIProxy != nil {
useAutoAuthToken = true
proxyVaultToken = !config.APIProxy.ForceAutoAuthToken
}
var muxHandler http.Handler
if leaseCache != nil {
muxHandler = cache.ProxyHandler(ctx, apiProxyLogger, leaseCache, inmemSink, proxyVaultToken, authInProgress, invalidTokenErrCh)
muxHandler = cache.ProxyHandler(ctx, apiProxyLogger, leaseCache, inmemSink, proxyVaultToken, useAutoAuthToken, authInProgress, invalidTokenErrCh)
} else {
muxHandler = cache.ProxyHandler(ctx, apiProxyLogger, apiProxy, inmemSink, proxyVaultToken, authInProgress, invalidTokenErrCh)
muxHandler = cache.ProxyHandler(ctx, apiProxyLogger, apiProxy, inmemSink, proxyVaultToken, useAutoAuthToken, authInProgress, invalidTokenErrCh)
}
// Parse 'require_request_header' listener config option, and wrap