- Two inbound domains on one upstream could never change its TLS mode,
each save refused for the other (medium): SetTransportAs changes the
mode for every domain on the upstream when the one saving may change
them all; a domain user who may not is refused with the mode, not the
other tenant's domain name (security F1: the first version named it).
- A deletion's leftover DKIM key is removed by Resync (Reload
configuration, a restore's first start) for names no domain has.
- The backup's write deadline moves before Check.
- hasUnsavedEdit skips password and file fields and compares a multiple
select's options; htmx.config.timeout 30 s, so a refresh never answered
ends and is tried again; a failed refresh's promise is handled.
- An empty filtered Outbound log says no message matches the filters.
- The dummy bcrypt hash is made at start; a DMARC part over 8 MiB is
refused for its size like the other two limits.
- Health's Configuration box says what Reload writes (design first,
32dfe4a).
- Docs: CHANGELOG, guide § Inbound, security.md (the shared upstream's
mode, the profile form's "username taken"), architecture.md (owed to an
address), the plan's notes corrected.
Tests: the shared upstream (service, handler), the leftover key, all eight
Health boxes ordered, the subject from before migration 0011, the new JS
cases.
Tested on the test server: go vet + go test of 25 packages, make e2e (all
pass, 636 s) on this tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@@ -227,3 +228,37 @@ func TestInboundDeletePageNamesWhatGoesWithTheDomain(t *testing.T) {
|
||||
has(t, "delete page, any recipient", body, `remove its upstream.`)
|
||||
lacks(t, "delete page, any recipient", body, `recipient`)
|
||||
}
|
||||
|
||||
// A domain user saving an upstream another tenant's inbound domain shares,
|
||||
// with another TLS mode, is told the mode and not the domain; the global
|
||||
// role changes the mode for both (security and technical reviews of audit
|
||||
// stage 4).
|
||||
func TestSharedUpstreamTLSModeForADomainUser(t *testing.T) {
|
||||
h, st := inboundHandlers(t)
|
||||
mine, _ := h.inbound.Add("mine.example")
|
||||
theirs, _ := h.inbound.Add("theirs.example")
|
||||
if err := h.inbound.SetTransport(theirs.ID, "10.0.0.8", "25", "encrypt"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
p := userWith(t, st, "tenant", store.RoleDomain, store.Reach{InboundDomainIDs: []int64{mine.ID}})
|
||||
form := url.Values{"host": {"10.0.0.8"}, "port": {"25"}, "tls_mode": {"may"}}
|
||||
rec := inboundCall(h, http.MethodPost, fmt.Sprintf("/inbound/domains/%d/upstream", mine.ID), form, p)
|
||||
body := rec.Body.String()
|
||||
if rec.Code != http.StatusBadRequest || !strings.Contains(body, "with TLS mode encrypt, by an inbound domain you do not manage") {
|
||||
t.Fatalf("a domain user on another's upstream = %d:\n%s", rec.Code, body)
|
||||
}
|
||||
if strings.Contains(body, "theirs.example") {
|
||||
t.Error("the refusal names the other tenant's domain")
|
||||
}
|
||||
|
||||
if err := h.inbound.SetTransport(mine.ID, "10.0.0.8", "25", "encrypt"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
rec = inboundCall(h, http.MethodPost, fmt.Sprintf("/inbound/domains/%d/upstream", mine.ID), form, globalPrincipal)
|
||||
if rec.Code != http.StatusSeeOther || !strings.Contains(rec.Header().Get("Location"), "shared=1") {
|
||||
t.Fatalf("the global role changing a shared mode = %d %q", rec.Code, rec.Header().Get("Location"))
|
||||
}
|
||||
if d, _ := st.GetInboundDomain(theirs.ID); d.TLSMode != "may" {
|
||||
t.Errorf("the other domain kept %s", d.TLSMode)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user