Normalize protected steering names and clarify alias refusal
3 files changed,
+4
−4
internal/console/apidomains.go+1 −1internal/console/domainattach.go+1 −1internal/console/domainpolicy_test.go+2 −2
CI passed — run details
diff --git a/internal/console/apidomains.go b/internal/console/apidomains.go| index 6c445375a..6334642dc 100644 |
| --- a/internal/console/apidomains.go |
| +++ b/internal/console/apidomains.go |
| @@ -95,7 +95,7 @@ func (s *Server) deniedDomains(exemptAppsDomain bool) []string { |
| } |
| deny = append(deny, entry) |
| } |
| - steeringHost := normalizeHost(s.cfg.SteeringHost) |
| + steeringHost := strings.TrimSuffix(normalizeHost(strings.TrimSpace(s.cfg.SteeringHost)), ".") |
| if steeringHost == "" && domain != "" { |
| steeringHost = "edge." + domain |
| } |
diff --git a/internal/console/domainattach.go b/internal/console/domainattach.go| index a44b414d6..2f4aff914 100644 |
| --- a/internal/console/domainattach.go |
| +++ b/internal/console/domainattach.go |
| @@ -156,7 +156,7 @@ func (s *Server) attachDomain(ctx context.Context, acct *Account, app, host, kin |
| } |
| if s.directAppsDomainHost(host) { |
| - return attachResult{}, &doorRefusal{http.StatusUnprocessableEntity, "an app with no running route can only attach a static domain — deploy first, then attach"} |
| + return attachResult{}, &doorRefusal{http.StatusUnprocessableEntity, hostUnavailableMsg} |
| } |
| // --- first-route attach: this host becomes the app's primary -------- |
diff --git a/internal/console/domainpolicy_test.go b/internal/console/domainpolicy_test.go| index 576bb6c5d..3fa13e27e 100644 |
| --- a/internal/console/domainpolicy_test.go |
| +++ b/internal/console/domainpolicy_test.go |
| @@ -250,8 +250,8 @@ func TestAppsDomainAliasAccountAuthority(t *testing.T) { |
| t.Errorf("%s/%s: denied=%v, want %v", tc.account, tc.host, got, tc.denied) |
| } |
| } |
| - s.cfg.SteeringHost = "steering.platform.example.test" |
| - if !s.domainHostDenied(s.cfg.SteeringHost, "bap") { |
| + s.cfg.SteeringHost = "steering.platform.example.test." |
| + if !s.domainHostDenied("steering.platform.example.test", "bap") { |
| t.Fatal("steering host allowed") |
| } |
| } |