-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mechanism to create keys in a declarative way
This commit adds a mechanism to create keys in a declarative way. Now, keys can be specified in the `keys` section of the config file: ``` keys: - name: my-key - name: my-key2 ``` The KES server will create these keys before startup. This commit is a breaking change. The `keys` section was used to define the KMS/KeyStore backend. Now, the KMS backend can be specified in the `keystore` section. However, the KES server will support the previous config file format for a limited amount of time. It will first try to parse the config file assuming the current format and - if that fails - try to parse the config file again assuming the previous format.
- Loading branch information
Andreas Auernhammer
committed
Mar 23, 2021
1 parent
a7def79
commit a310981
Showing
5 changed files
with
145 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright 2021 - MinIO, Inc. All rights reserved. | ||
// Use of this source code is governed by the AGPLv3 | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
import "github.com/minio/kes" | ||
|
||
// serverConfigV0135 represents a KES server configuration up to | ||
// v0.13.5. It provides backward-compatible unmarshaling of exiting | ||
// configuration files. | ||
// | ||
// It will be removed at some time in the future. | ||
type serverConfigV0135 struct { | ||
Addr string `yaml:"address"` | ||
Root kes.Identity `yaml:"root"` | ||
|
||
TLS struct { | ||
KeyPath string `yaml:"key"` | ||
CertPath string `yaml:"cert"` | ||
Proxy struct { | ||
Identities []kes.Identity `yaml:"identities"` | ||
Header struct { | ||
ClientCert string `yaml:"cert"` | ||
} `yaml:"header"` | ||
} `yaml:"proxy"` | ||
} `yaml:"tls"` | ||
|
||
Policies map[string]struct { | ||
Paths []string `yaml:"paths"` | ||
Identities []kes.Identity `yaml:"identities"` | ||
} `yaml:"policy"` | ||
|
||
Cache struct { | ||
Expiry struct { | ||
Any duration `yaml:"any"` // Use custom type for env. var support | ||
Unused duration `yaml:"unused"` // Use custom type for env. var support | ||
} `yaml:"expiry"` | ||
} `yaml:"cache"` | ||
|
||
Log struct { | ||
Error string `yaml:"error"` | ||
Audit string `yaml:"audit"` | ||
} `yaml:"log"` | ||
|
||
Keys kmsServerConfig `yaml:"keys"` | ||
} | ||
|
||
func (c *serverConfigV0135) Migrate() serverConfig { | ||
return serverConfig{ | ||
Addr: c.Addr, | ||
Root: c.Root, | ||
TLS: c.TLS, | ||
Policies: c.Policies, | ||
Cache: c.Cache, | ||
Log: c.Log, | ||
KeyStore: c.Keys, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters