normalizeRules returns `nil` if policy is nil, the `Allow` and `Deny` rules are `nil`,
()
| 65 | |
| 66 | // normalizeRules returns `nil` if policy is nil, the `Allow` and `Deny` rules are `nil`, |
| 67 | func (p *Policy) normalizeRules() *provisioner.X509Options { |
| 68 | if p == nil { |
| 69 | return nil |
| 70 | } |
| 71 | |
| 72 | allow := p.normalizeAllowRules() |
| 73 | deny := p.normalizeDenyRules() |
| 74 | if allow == nil && deny == nil && !p.AllowWildcardNames { |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | return &provisioner.X509Options{ |
| 79 | AllowedNames: allow, |
| 80 | DeniedNames: deny, |
| 81 | AllowWildcardNames: p.AllowWildcardNames, |
| 82 | } |
| 83 | } |