mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
New Admin Info (#8497)
This commit is contained in:
committed by
kannappanr
parent
8b803491af
commit
24fb1bf258
@@ -102,6 +102,9 @@ type KMS interface {
|
||||
// keys this method may behave like a NOP and just return the sealedKey
|
||||
// itself.
|
||||
UpdateKey(keyID string, sealedKey []byte, context Context) (rotatedKey []byte, err error)
|
||||
|
||||
// Returns KMSInfo
|
||||
Info() (kmsInfo KMSInfo)
|
||||
}
|
||||
|
||||
type masterKeyKMS struct {
|
||||
@@ -109,6 +112,13 @@ type masterKeyKMS struct {
|
||||
masterKey [32]byte
|
||||
}
|
||||
|
||||
// KMSInfo stores the details of KMS
|
||||
type KMSInfo struct {
|
||||
Endpoint string
|
||||
Name string
|
||||
AuthType string
|
||||
}
|
||||
|
||||
// NewMasterKey returns a basic KMS implementation from a single 256 bit master key.
|
||||
//
|
||||
// The KMS accepts any keyID but binds the keyID and context cryptographically
|
||||
@@ -135,6 +145,15 @@ func (kms *masterKeyKMS) GenerateKey(keyID string, ctx Context) (key [32]byte, s
|
||||
return key, sealedKey, nil
|
||||
}
|
||||
|
||||
// KMS is configured directly using master key
|
||||
func (kms *masterKeyKMS) Info() (info KMSInfo) {
|
||||
return KMSInfo{
|
||||
Endpoint: "",
|
||||
Name: "",
|
||||
AuthType: "master-key",
|
||||
}
|
||||
}
|
||||
|
||||
func (kms *masterKeyKMS) UnsealKey(keyID string, sealedKey []byte, ctx Context) (key [32]byte, err error) {
|
||||
var (
|
||||
buffer bytes.Buffer
|
||||
|
||||
@@ -195,6 +195,15 @@ func (v *vaultService) KeyID() string {
|
||||
return v.config.Key.Name
|
||||
}
|
||||
|
||||
// Returns - vault info
|
||||
func (v *vaultService) Info() (kmsInfo KMSInfo) {
|
||||
return KMSInfo{
|
||||
Endpoint: v.config.Endpoint,
|
||||
Name: v.config.Key.Name,
|
||||
AuthType: v.config.Auth.Type,
|
||||
}
|
||||
}
|
||||
|
||||
// GenerateKey returns a new plaintext key, generated by the KMS,
|
||||
// and a sealed version of this plaintext key encrypted using the
|
||||
// named key referenced by keyID. It also binds the generated key
|
||||
|
||||
Reference in New Issue
Block a user