generated from theparanoids/.github
/
conf.go
31 lines (26 loc) · 1.03 KB
/
conf.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
// Copyright 2022 Yahoo Inc.
// Licensed under the terms of the Apache License 2.0. Please see LICENSE file in project root for terms.
package regular
import "crypto/x509"
const (
defaultCertLabel = "regular"
defaultPubKeyDir = "/etc/ssh/authorized_public_keys"
defaultCertValiditySec = 12 * 3600 // 12 hours
)
type conf struct {
// PubKeyDir specifies the folder path which stores users' public keys.
PubKeyDir string `mapstructure:"pub_key_dir"`
// KeyIdentifiers is the mapping from CA public key algorithm to the key identifier configured in signer.
KeyIdentifiers map[x509.PublicKeyAlgorithm]string `mapstructure:"key_identifiers"`
// CertLabel is the comment followed by the provisioned cert.
CertLabel string `mapstructure:"key_label"`
// CertValiditySec is the time length of cert validity.
CertValiditySec uint64 `mapstructure:"cert_validity_sec"`
}
func newDefaultConf() *conf {
return &conf{
PubKeyDir: defaultPubKeyDir,
CertLabel: defaultCertLabel,
CertValiditySec: defaultCertValiditySec,
}
}