mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Set meaningful message from minio with env variable KMS_SECRET_KEY (#16584)
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
|
||||
"github.com/minio/kes-go"
|
||||
"github.com/minio/pkg/certs"
|
||||
"github.com/minio/pkg/env"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -189,6 +190,26 @@ func (c *kesClient) Stat(ctx context.Context) (Status, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// IsLocal returns true if the KMS is a local implementation
|
||||
func (c *kesClient) IsLocal() bool {
|
||||
return env.IsSet(EnvKMSSecretKey)
|
||||
}
|
||||
|
||||
// List returns an array of local KMS Names
|
||||
func (c *kesClient) List() []kes.KeyInfo {
|
||||
var kmsSecret []kes.KeyInfo
|
||||
envKMSSecretKey := env.Get(EnvKMSSecretKey, "")
|
||||
values := strings.SplitN(envKMSSecretKey, ":", 2)
|
||||
if len(values) == 2 {
|
||||
kmsSecret = []kes.KeyInfo{
|
||||
{
|
||||
Name: values[0],
|
||||
},
|
||||
}
|
||||
}
|
||||
return kmsSecret
|
||||
}
|
||||
|
||||
// Metrics retrieves server metrics in the Prometheus exposition format.
|
||||
func (c *kesClient) Metrics(ctx context.Context) (kes.Metric, error) {
|
||||
c.lock.RLock()
|
||||
|
||||
Reference in New Issue
Block a user