diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-15 21:22:26 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-15 21:22:26 -0600 |
commit | 0433f9d075452d78ac93c72bad37856dc1b5b6f7 (patch) | |
tree | d76f628e98bceff36b59897dafabe2c2b515bfe5 /caddyconfig | |
parent | c67c8e60ccba736ed06f6a86c1fa2922e81a285f (diff) |
caddytls: Clean up some code related to automation
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/httpcaddyfile/httptype.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index c37b5f2..e0a6c1c 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -195,7 +195,7 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock, tlsApp.Automation = new(caddytls.AutomationConfig) } tlsApp.Automation.Policies = append(tlsApp.Automation.Policies, &caddytls.AutomationPolicy{ - Hosts: sblockHosts, + Subjects: sblockHosts, IssuerRaw: caddyconfig.JSONModuleObject(issuer, "module", issuer.(caddy.Module).CaddyModule().ID.Name(), &warnings), }) } else { @@ -768,17 +768,17 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls // if the policy is the same, we can keep just one, but we have // to be careful which one we keep; if only one has any hostnames // defined, then we need to keep the one without any hostnames, - // otherwise the one without any hosts (a catch-all) would be - // eaten up by the one with hosts; and if both have hosts, we + // otherwise the one without any subjects (a catch-all) would be + // eaten up by the one with subjects; and if both have subjects, we // need to combine their lists if reflect.DeepEqual(aps[i].IssuerRaw, aps[j].IssuerRaw) && aps[i].ManageSync == aps[j].ManageSync { - if len(aps[i].Hosts) == 0 && len(aps[j].Hosts) > 0 { + if len(aps[i].Subjects) == 0 && len(aps[j].Subjects) > 0 { aps = append(aps[:j], aps[j+1:]...) - } else if len(aps[i].Hosts) > 0 && len(aps[j].Hosts) == 0 { + } else if len(aps[i].Subjects) > 0 && len(aps[j].Subjects) == 0 { aps = append(aps[:i], aps[i+1:]...) } else { - aps[i].Hosts = append(aps[i].Hosts, aps[j].Hosts...) + aps[i].Subjects = append(aps[i].Subjects, aps[j].Subjects...) aps = append(aps[:j], aps[j+1:]...) } i-- @@ -789,7 +789,7 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls // ensure any catch-all policies go last sort.SliceStable(aps, func(i, j int) bool { - return len(aps[i].Hosts) > len(aps[j].Hosts) + return len(aps[i].Subjects) > len(aps[j].Subjects) }) return aps |