normalizeAllowRules returns `nil` if policy is nil, the `Allow` rule is `nil`, or all rules within the `Allow` rule are empty. Otherwise, it returns the X509NameOptions with the content of the `Allow` rule.
()
| 41 | // or all rules within the `Allow` rule are empty. Otherwise, it returns the X509NameOptions |
| 42 | // with the content of the `Allow` rule. |
| 43 | func (p *Policy) normalizeAllowRules() *policy.X509NameOptions { |
| 44 | if (p == nil) || (p.Allow == nil) || (len(p.Allow.Domains) == 0 && len(p.Allow.IPRanges) == 0) { |
| 45 | return nil |
| 46 | } |
| 47 | return &policy.X509NameOptions{ |
| 48 | DNSDomains: p.Allow.Domains, |
| 49 | IPRanges: p.Allow.IPRanges, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // normalizeDenyRules returns `nil` if policy is nil, the `Deny` rule is `nil`, |
| 54 | // or all rules within the `Deny` rule are empty. Otherwise, it returns the X509NameOptions |
no outgoing calls