-
Notifications
You must be signed in to change notification settings - Fork 15
/
api.go
34 lines (28 loc) · 917 Bytes
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package config
import (
"crypto/x509"
"github.com/Symantec/Dominator/lib/log"
)
type BaseConfig struct {
Gen_Cert_URLS string `yaml:"gen_cert_urls"`
Username string `yaml:"username"`
}
// AppConfigFile represents a keymaster client configuration file
type AppConfigFile struct {
Base BaseConfig
}
// LoadVerifyConfigFile reads, verifies, and returns the contents of
// a keymaster configuration file. LoadVerifyConfigFile returns an error if the
// configuration file is invalid.
func LoadVerifyConfigFile(configFilename string) (AppConfigFile, error) {
return loadVerifyConfigFile(configFilename)
}
// GetConfigFromHost grabs a default config file from a given host and stores
// it in the local file system.
func GetConfigFromHost(
configFilename string,
hostname string,
rootCAs *x509.CertPool,
logger log.Logger) error {
return getConfigFromHost(configFilename, hostname, rootCAs, logger)
}