You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/tlsutil/mock.go

38 lines
842 B

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package tlsutil
import "crypto/tls"
var _ ConfiguratorIface = (*MockConfigurator)(nil)
// MockConfigurator is used for mocking the ConfiguratorIface in testing
type MockConfigurator struct {
BaseConfig Config
TlsCert *tls.Certificate
ManualCAPemsArr []string
VerifyIncomingRPCBool bool
VerifyServerHostnameBool bool
}
func (m MockConfigurator) Base() Config {
return m.BaseConfig
}
func (m MockConfigurator) Cert() *tls.Certificate {
return m.TlsCert
}
func (m MockConfigurator) ManualCAPems() []string {
return m.ManualCAPemsArr
}
func (m MockConfigurator) VerifyIncomingRPC() bool {
return m.VerifyIncomingRPCBool
}
func (m MockConfigurator) VerifyServerHostname() bool {
return m.VerifyServerHostnameBool
}