Documentation ¶
Overview ¶
Package zpu is a utility library to update ZPE Policy.
Index ¶
- Constants
- func GetEtagForExistingPolicy(config *ZpuConfiguration, ztsClient zts.ZTSClient, ...) (string, error)
- 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 = 86400 )
Default and maximal startup delay values.
Variables ¶
This section is empty.
Functions ¶
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"` MetricsDir string `json:"metricsDir"` LogMaxSize int `json:"logMaxsize"` LogMaxAge int `json:"logMaxage"` LogMaxBackups int `json:"logMaxbackups"` LogCompress bool `json:"logCompress"` }
func ReadZpuConf ¶
type ZpuConfiguration ¶
type ZpuConfiguration struct { Zts string Zms string DomainList string ZpuOwner string PolicyFileDir string TmpPolicyFileDir string MetricsDir string ZmsKeysmap map[string]string ZtsKeysmap map[string]string StartUpDelay int LogSize int LogAge int LogBackups int LogCompression bool }
func NewZpuConfiguration ¶
func NewZpuConfiguration(root, athensConfFile, zpuConfFile, tmpPolicyFileDir 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.