-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.go
47 lines (42 loc) · 1.72 KB
/
configuration.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
35
36
37
38
39
40
41
42
43
44
45
46
47
package certMgr
// AppConfig provides the global configuration of the application.
type AppConfig struct {
Certificate string // the pem-encoded certificate for the service
CertFilename string // the name of the file containing the pem-encoded certicate for the service
Insecure bool // for testing purposes, do not start-up TLS endpoints
KeyFilename string // the name of the file containing the pem-encoded key for the service's cert
Config string // load config data from this file (may be a url)
HTTPListenAddress string
GRPCListenAddress string
AuthServiceAddress string
Verbose bool
// specific config options for each command & subcommand
Backend BackendConfig
}
type BackendConfig struct {
AuthorizedCreators []string // users authorized to create new certificates (an empty list permits anyone)
Bundle string // the pem-encoded bundle of intermediate CA's
SigningCACertificate string // the pem-encoded signing CA
SigningCAKeyFilename string // filename for the CA key
MaxDuration int // maximum # of days this CA will issue a cert
}
// the default configuration
var (
DefaultAppConfig = &AppConfig{
CertFilename: "cert.pem",
KeyFilename: "key.pem",
Config: "",
HTTPListenAddress: ":8443",
GRPCListenAddress: ":50051",
AuthServiceAddress: "auth.dstcorp.net:443",
Insecure: false,
Verbose: false,
Backend: defaultBackendConfig,
}
// defaultConfig holds default values
defaultBackendConfig = BackendConfig{
AuthorizedCreators: []string{""},
SigningCAKeyFilename: "ca-key.pem",
MaxDuration: 365, // max duration, in days, for any certificate
}
)