2022-08-23 20:44:10 +00:00
|
|
|
package nomad
|
|
|
|
|
|
|
|
import (
|
2023-02-27 17:27:40 +00:00
|
|
|
"time"
|
|
|
|
|
2022-08-23 20:44:10 +00:00
|
|
|
"golang.org/x/exp/slices"
|
|
|
|
)
|
|
|
|
|
|
|
|
// LicenseConfig allows for tunable licensing config
|
|
|
|
// primarily used for enterprise testing
|
|
|
|
type LicenseConfig struct {
|
2023-02-27 17:27:40 +00:00
|
|
|
// BuildDate is the time of the git commit used to build the program.
|
|
|
|
BuildDate time.Time
|
|
|
|
|
2022-08-23 20:44:10 +00:00
|
|
|
// LicenseEnvBytes is the license bytes to use for the server's license
|
|
|
|
LicenseEnvBytes string
|
|
|
|
|
|
|
|
// LicensePath is the path to use for the server's license
|
|
|
|
LicensePath string
|
|
|
|
|
|
|
|
// AdditionalPubKeys is a set of public keys to
|
|
|
|
AdditionalPubKeys []string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *LicenseConfig) Copy() *LicenseConfig {
|
|
|
|
if c == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
nc := *c
|
|
|
|
nc.AdditionalPubKeys = slices.Clone(c.AdditionalPubKeys)
|
|
|
|
return &nc
|
|
|
|
}
|