Background
GoCB deprecated CertificateAuthenticator in GOCBC-304 - which should've been backwards compatible. However, another commit causes a runtime error when the old struct is used.
// CertificateAuthenticator is included for backwards compatibility only.
|
// Deprecated: Use CertAuthenticator instead.
|
type CertificateAuthenticator struct {
|
CertAuthenticator
|
}
|
_, ok := auth.(CertAuthenticator)
|
if !ok {
|
return nil, ErrMixedCertAuthentication
|
}
|
Fix
- We should update our cluster.Authenticate(gocb.CertificateAuthenticator{}) call to use the new struct instead to fix this.
Testing
- We should also try to get some sort of test coverage that would've caught this runtime error, even if we can't easily get a full end-to-end x.509 integration test.
Perhaps an untrusted client cert would be sufficient enough to test that we can attempt to authenticate with the cluster.