console: members see only the registrant's name on a domain's page
Registrant details are personal data, owners only as saved contacts are (spec §11.5). Members' Registered to card keeps the name; email and country are the owner's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+43
−4
internal/console/accountdomainspage.go+7 −4internal/console/accountdomainspage_test.go+36 −0
CI failed — run details
diff --git a/internal/console/accountdomainspage.go b/internal/console/accountdomainspage.go| index 0cd269383..62ad24f5f 100644 |
| --- a/internal/console/accountdomainspage.go |
| +++ b/internal/console/accountdomainspage.go |
| @@ -412,10 +412,13 @@ func (s *Server) domainPage(ctx context.Context, acct *Account, owner bool, c do |
| v.PointNote = domainsFill(domainsPageCopy.PointNote, "{domain}", c.Domain) |
| } |
| if rc := c.Registration.Registrant; rc.FirstName != "" || rc.LastName != "" || rc.Email != "" { |
| - v.Registrant = []domainTile{ |
| - {Label: domainsPageCopy.Name, Value: strings.TrimSpace(rc.FirstName + " " + rc.LastName)}, |
| - {Label: domainsPageCopy.Email, Value: rc.Email}, |
| - {Label: domainsPageCopy.Country, Value: countryName(rc.Country)}, |
| + // The name for everyone; the rest is personal data, owners only, as |
| + // saved contacts are (spec §11.5). |
| + v.Registrant = []domainTile{{Label: domainsPageCopy.Name, Value: strings.TrimSpace(rc.FirstName + " " + rc.LastName)}} |
| + if owner { |
| + v.Registrant = append(v.Registrant, |
| + domainTile{Label: domainsPageCopy.Email, Value: rc.Email}, |
| + domainTile{Label: domainsPageCopy.Country, Value: countryName(rc.Country)}) |
| } |
| } |
| v.Managed = len(cv.Addresses) > 0 |
diff --git a/internal/console/accountdomainspage_test.go b/internal/console/accountdomainspage_test.go| index f8dda3703..e657e6e05 100644 |
| --- a/internal/console/accountdomainspage_test.go |
| +++ b/internal/console/accountdomainspage_test.go |
| @@ -485,3 +485,39 @@ func TestDomainStateChipNeverBlank(t *testing.T) { |
| func domainStatesForChips() []string { |
| return []string{StatePendingDNS, StateMisdirected, StateIssuingCert, StateLive, StateChecking, StateFailed, StateUnknown, StateUnverified, StateRegional} |
| } |
| + |
| +// Registrant details are personal data, owners only like saved contacts |
| +// (spec §11.5): a member's Registered to card has the name alone. |
| +func TestDomainPageMemberSeesRegistrantNameOnly(t *testing.T) { |
| + fx, acct := adFixture(t, consoleFixtureOptions{}) |
| + adBought(t, fx, acct, "bought.com", time.Now().AddDate(1, 0, 0)) |
| + rc := purchaseContact() |
| + personal := []string{rc.Email, "Ireland", rc.Street, rc.City, rc.PostalCode, rc.Phone, |
| + "<dt>" + domainsPageCopy.Email + "</dt>", "<dt>" + domainsPageCopy.Country + "</dt>"} |
| + |
| + member := adMember(t, fx, acct) |
| + status, body := adGet(t, fx, member, acct, "/domains/bought.com") |
| + if status != http.StatusOK { |
| + t.Fatalf("member GET = %d", status) |
| + } |
| + main := mainOf(t, body) |
| + for _, want := range []string{"<h2>" + domainsPageCopy.RegisteredTo + "</h2>", "<dt>" + domainsPageCopy.Name + "</dt><dd>Jane Buyer</dd>"} { |
| + if !strings.Contains(main, want) { |
| + t.Errorf("member's page lacks %q:\n%s", want, main) |
| + } |
| + } |
| + for _, banned := range personal { |
| + if strings.Contains(main, banned) { |
| + t.Errorf("member's page shows %q", banned) |
| + } |
| + } |
| + |
| + owner := adSignIn(t, fx, adOwner(acct)) |
| + _, body = adGet(t, fx, owner, acct, "/domains/bought.com") |
| + main = mainOf(t, body) |
| + for _, want := range []string{"<dd>Jane Buyer</dd>", "<dd>" + rc.Email + "</dd>", "<dd>Ireland</dd>"} { |
| + if !strings.Contains(main, want) { |
| + t.Errorf("owner's page lacks %q", want) |
| + } |
| + } |
| +} |