618deae657
Previously, we'd begin a session with the xDS concurrency limiter regardless of whether the proxy was registered in the catalog or in the server's local agent state. This caused problems for users who run `consul connect envoy` directly against a server rather than a client agent, as the server's locally registered proxies wouldn't be included in the limiter's capacity. Now, the `ConfigSource` is responsible for beginning the session and we only do so for services in the catalog. Fixes: https://github.com/hashicorp/consul/issues/15753
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
// Code generated by mockery v2.15.0. DO NOT EDIT.
|
|
|
|
package connectca
|
|
|
|
import (
|
|
acl "github.com/hashicorp/consul/acl"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
structs "github.com/hashicorp/consul/agent/structs"
|
|
|
|
x509 "crypto/x509"
|
|
)
|
|
|
|
// MockCAManager is an autogenerated mock type for the CAManager type
|
|
type MockCAManager struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AuthorizeAndSignCertificate provides a mock function with given fields: csr, authz
|
|
func (_m *MockCAManager) AuthorizeAndSignCertificate(csr *x509.CertificateRequest, authz acl.Authorizer) (*structs.IssuedCert, error) {
|
|
ret := _m.Called(csr, authz)
|
|
|
|
var r0 *structs.IssuedCert
|
|
if rf, ok := ret.Get(0).(func(*x509.CertificateRequest, acl.Authorizer) *structs.IssuedCert); ok {
|
|
r0 = rf(csr, authz)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*structs.IssuedCert)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(*x509.CertificateRequest, acl.Authorizer) error); ok {
|
|
r1 = rf(csr, authz)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
type mockConstructorTestingTNewMockCAManager interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewMockCAManager creates a new instance of MockCAManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewMockCAManager(t mockConstructorTestingTNewMockCAManager) *MockCAManager {
|
|
mock := &MockCAManager{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|