mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-31 23:56:36 +08:00
增加UAM(5秒盾)集群设置
This commit is contained in:
@@ -78,6 +78,9 @@ type NodeConfig struct {
|
||||
// WebP
|
||||
WebPImagePolicies map[int64]*WebPImagePolicy `yaml:"webpImagePolicies" json:"webpImagePolicies"` // clusterId => *WebPImagePolicy
|
||||
|
||||
// UAM相关配置
|
||||
UAMPolicies map[int64]*UAMPolicy `yaml:"uamPolicies" yaml:"uamPolicies" json:"uamPolicies"` // clusterId => *UAMPolicy
|
||||
|
||||
// DNS
|
||||
DNSResolver *DNSResolverConfig `yaml:"dnsResolver" json:"dnsResolver"`
|
||||
|
||||
@@ -310,6 +313,16 @@ func (this *NodeConfig) Init() (err error, serverErrors []*ServerError) {
|
||||
}
|
||||
}
|
||||
|
||||
// uam policy
|
||||
if this.UAMPolicies != nil {
|
||||
for _, policy := range this.UAMPolicies {
|
||||
err = policy.Init()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dns resolver
|
||||
if this.DNSResolver != nil {
|
||||
err = this.DNSResolver.Init()
|
||||
@@ -508,6 +521,14 @@ func (this *NodeConfig) FindWebPImagePolicyWithClusterId(clusterId int64) *WebPI
|
||||
return this.WebPImagePolicies[clusterId]
|
||||
}
|
||||
|
||||
// FindUAMPolicyWithClusterId 使用集群ID查找UAM策略
|
||||
func (this *NodeConfig) FindUAMPolicyWithClusterId(clusterId int64) *UAMPolicy {
|
||||
if this.UAMPolicies == nil {
|
||||
return nil
|
||||
}
|
||||
return this.UAMPolicies[clusterId]
|
||||
}
|
||||
|
||||
// SecretHash 对Id和Secret的Hash计算
|
||||
func (this *NodeConfig) SecretHash() string {
|
||||
return this.secretHash
|
||||
|
||||
Reference in New Issue
Block a user