mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-02 03:46:29 +02:00
* Initial test environment implementation * linter pass * wip: update request latency test * bugfixes * Fix logic race in envoy process monitor when canceling context * skip tests using test environment on non-linux
24 lines
605 B
Go
24 lines
605 B
Go
package scenarios
|
|
|
|
import (
|
|
"context"
|
|
"encoding/base64"
|
|
"encoding/pem"
|
|
|
|
"github.com/pomerium/pomerium/config"
|
|
"github.com/pomerium/pomerium/internal/testenv"
|
|
)
|
|
|
|
func DownstreamMTLS(mode config.MTLSEnforcement) testenv.Modifier {
|
|
return testenv.ModifierFunc(func(ctx context.Context, cfg *config.Config) {
|
|
env := testenv.EnvFromContext(ctx)
|
|
block := pem.Block{
|
|
Type: "CERTIFICATE",
|
|
Bytes: env.CACert().Leaf.Raw,
|
|
}
|
|
cfg.Options.DownstreamMTLS = config.DownstreamMTLSSettings{
|
|
CA: base64.StdEncoding.EncodeToString(pem.EncodeToMemory(&block)),
|
|
Enforcement: mode,
|
|
}
|
|
})
|
|
}
|