fix (servers): return unhandled err from storeRootCertificates(...) (#2127)
This commit is contained in:
2 files changed
+7
-1
No files matched your search
@@ -248,8 +248,13 @@ func (r *WorkerAuthRepositoryStorage) storeRootCertificates(ctx context.Context,
|
||||
}
|
||||
|
||||
nextCert, err := r.convertRootCertificate(ctx, cert.Next)
|
||||
if err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("unable to convert next root certificate"))
|
||||
}
|
||||
currentCert, err := r.convertRootCertificate(ctx, cert.Current)
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("unable to convert current root certificate"))
|
||||
}
|
||||
// Use passed version
|
||||
var result rootCertificatesVersion
|
||||
err = mapstructure.Decode(cert.State.AsMap(), &result)
|
||||
|
||||
@@ -255,6 +255,7 @@ func TestDuplicateRootCert(t *testing.T) {
|
||||
current2, err := newRootCertificate(ctx, rand.Uint64(), populateBytes(defaultLength), beforeTimestamp, afterTimestamp,
|
||||
RootCertificateKeys{publicKey: populateBytes(defaultLength), privateKey: populateBytes(defaultLength)},
|
||||
testKey, CurrentState)
|
||||
require.NoError(t, err)
|
||||
next1, err := newRootCertificate(ctx, rand.Uint64(), populateBytes(defaultLength), beforeTimestamp, afterTimestamp,
|
||||
RootCertificateKeys{publicKey: populateBytes(defaultLength), privateKey: populateBytes(defaultLength)},
|
||||
testKey, NextState)
|
||||
|
||||
Reference in new issue
Block a user