Documentation ¶
Overview ¶
Package zpu is a utility library to update ZPE Policy.
Index ¶
- Constants
- func GetEtagForExistingPolicy(config *ZpuConfiguration, ztsClient zts.ZTSClient, ...) string
- func GetPolicies(config *ZpuConfiguration, ztsClient zts.ZTSClient, ...) error
- func PolicyUpdater(config *ZpuConfiguration) error
- func PostAllDomainMetric(ztsClient zts.ZTSClient, metricFilePath string) error
- func ValidateSignedPolicies(config *ZpuConfiguration, ztsClient zts.ZTSClient, ...) error
- func WritePolicies(config *ZpuConfiguration, data *zts.DomainSignedPolicyData, ...) error
- type AthenzConf
- type ZpuConf
- type ZpuConfiguration
Constants ¶
View Source
const ( DEFAULT_STARTUP_DELAY = 0 MAX_STARTUP_DELAY = 1440 DEFAULT_EXPIRY_CHECK = 2880 )
Default and maximal startup delay values.
Variables ¶
This section is empty.
Functions ¶
func GetEtagForExistingPolicy ¶
func GetEtagForExistingPolicy(config *ZpuConfiguration, ztsClient zts.ZTSClient, domain, policyFileDir string) string
func GetPolicies ¶
func GetPolicies(config *ZpuConfiguration, ztsClient zts.ZTSClient, policyFileDir, domain string) error
func PolicyUpdater ¶
func PolicyUpdater(config *ZpuConfiguration) error
func PostAllDomainMetric ¶
func ValidateSignedPolicies ¶
func ValidateSignedPolicies(config *ZpuConfiguration, ztsClient zts.ZTSClient, data *zts.DomainSignedPolicyData) error
func WritePolicies ¶
func WritePolicies(config *ZpuConfiguration, data *zts.DomainSignedPolicyData, domain, policyFileDir string) error
If domain policy file is not found, create the policy file and write policies in it. Else delete the existing file and write the modified policies to new file.
Types ¶
type AthenzConf ¶
type AthenzConf struct { ZtsUrl string `json:"ztsUrl"` ZmsUrl string `json:"zmsUrl"` ZtsPublicKeys []struct { Id string `json:"id"` Key string `json:"key"` } `json:"ztsPublicKeys"` ZmsPublicKeys []struct { Id string `json:"id"` Key string `json:"key"` } `json:"zmsPublicKeys"` }
func ReadAthenzConf ¶
func ReadAthenzConf(athenzConf string) (*AthenzConf, error)
type ZpuConf ¶
type ZpuConf struct { Domains string `json:"domains"` User string `json:"user"` PolicyDir string `json:"policyDir"` TempPolicyDir string `json:"tempPolicyDir"` MetricsDir string `json:"metricsDir"` LogMaxSize int `json:"logMaxsize"` LogMaxAge int `json:"logMaxage"` LogMaxBackups int `json:"logMaxbackups"` LogCompress bool `json:"logCompress"` PrivateKey string `json:"privateKeyFile"` CertFile string `json:"certFile"` CaCertFile string `json:"caCertFile"` Proxy bool `json:"proxy"` }
func ReadZpuConf ¶
type ZpuConfiguration ¶
type ZpuConfiguration struct { Zts string Zms string DomainList string ZpuOwner string PolicyFileDir string TempPolicyFileDir string MetricsDir string ZmsKeysmap map[string]string ZtsKeysmap map[string]string StartUpDelay int ExpiryCheck int LogSize int LogAge int LogBackups int LogCompression bool PrivateKeyFile string CertFile string CaCertFile string Proxy bool }
func NewZpuConfiguration ¶
func NewZpuConfiguration(root, athensConfFile, zpuConfFile string) (*ZpuConfiguration, error)
func (ZpuConfiguration) GetZmsPublicKey ¶
func (config ZpuConfiguration) GetZmsPublicKey(key string) string
func (ZpuConfiguration) GetZtsPublicKey ¶
func (config ZpuConfiguration) GetZtsPublicKey(key string) string
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
tools
Tools is a program that runs zpu.PolicyUpdater.
|
Tools is a program that runs zpu.PolicyUpdater. |
Package devel provides utility functions for testing (StartMockServer and CreateFile).
|
Package devel provides utility functions for testing (StartMockServer and CreateFile). |
Package test_data contains test data packed as Go files.
|
Package test_data contains test data packed as Go files. |
Package util provides utility types and functions for zpe-updater.
|
Package util provides utility types and functions for zpe-updater. |
Click to show internal directories.
Click to hide internal directories.