mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
KES dependency upgrade (#14454)
- Updating KES dependency to v.0.18.0 - Fixing incompatibility issue when checking for errors during KES key creation Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/minio/kes"
|
||||
@@ -140,3 +141,10 @@ func (c *kesClient) DecryptKey(keyID string, ciphertext []byte, ctx Context) ([]
|
||||
}
|
||||
return c.client.Decrypt(context.Background(), keyID, ciphertext, ctxBytes)
|
||||
}
|
||||
|
||||
// KeyExists returns if key exists on KMS based on the provided error type
|
||||
func KeyExists(err error) bool {
|
||||
// legacyKeyExists will be used to maintain compatibility with KES versions older than v0.18.0
|
||||
legacyKeyExists := kes.NewError(http.StatusBadRequest, "key does already exist")
|
||||
return errors.Is(err, kes.ErrKeyExists) || errors.Is(err, legacyKeyExists)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user