MCPcopy
hub / github.com/caddyserver/caddy / normalizeAllowRules

Method normalizeAllowRules

modules/caddypki/acmeserver/policy.go:43–51  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

41// or all rules within the `Allow` rule are empty. Otherwise, it returns the X509NameOptions
42// with the content of the `Allow` rule.
43func (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

Callers 3

normalizeRulesMethod · 0.95
warnIfPolicyAllowsAllMethod · 0.80

Calls

no outgoing calls

Tested by 1