feat(branding): derive colour and logo from the signup domain (#155, part 2) #157
Closed
sharang
wants to merge 5 commits from
feat/branding-derive into main
pull from: feat/branding-derive
merge into: platform:main
platform:main
platform:feat/branding-derivation
platform:feat/scope-uploads-write
platform:feat/branding
platform:feat/einstieg-plan
platform:feat/update-policy
platform:feat/telemetry-relay
platform:feat/feedback-endpoint
platform:feat/onprem
platform:feat/onprem-mail
platform:feat/onprem-directory-users
platform:feat/onprem-mode
platform:feat/avv-autofill
platform:feat/release-avv-1.0.0
platform:fix/erpsetup-dunning-and-small
platform:feat/module-user-count
platform:feat/usage-summary
platform:feat/mahnung-ladder
platform:fix/toms-status-available
platform:feat/contractdocs-agb-tom
platform:feat/company-rules
platform:feat/staff-brand-slug
platform:fix/intake-outlives-purge
platform:fix/catalogue-labels
platform:feat/trial-offer-status
platform:feat/function-holders
platform:feat/assignable-bundles
platform:feat/contract-documents
platform:feat/erp-lb-versions
platform:feat/store-merges-unterlagen
platform:feat/product-hierarchy
platform:feat/preview-grants
platform:ci/platform-image-and-webhook
platform:ci/registry-meghsakha-orca-webhook
No Reviewers
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
cra:annex-i
cve
pruefwerk
risk:accepted
severity:critical
severity:high
severity:low
severity:medium
CRA Anhang I, wesentliche Cybersicherheitsanforderungen / CRA Annex I
Bekannte Schwachstelle in einer Abhängigkeit / known vulnerability in a dependency
Befund aus Prüfwerk / Prüfwerk finding
Risiko akzeptiert, nicht behoben / accepted risk, not fixed
Schweregrad kritisch / critical
Schweregrad hoch / high
Schweregrad niedrig / low
Schweregrad mittel / medium
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: platform/tenant-registry#157
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Customer branding (#155), part 2: the registry derives colour and logo from the home page of the workspace's company domain. #156 is merged (
9685ec04); main is merged into this branch, so the diff shows only the derivation.Behaviour
Domain: the admin address's registrable domain (eTLD+1).
derive_statefailed,no_domain, and no branding.Fetch (
internal/branding), per #155 step 2:http.Transport: no proxy, not the traced default (so no trace headers go to customer sites), no cookie jar.Dialer.Control, so after DNS and on every hop. Private, CGNAT, loopback, link-local, documentation and NAT64 ranges are refused.User-Agent: BreakpilotBranding/1.0, nothing about the customer.https://<domain>/, thenhttps://www.<domain>/.Colour, the first that is usable:
theme-colorwithoutmedia;theme_color;White, black and grey are skipped. Hex and
rgb()are read; named colours are not.Logo, the first candidate that downloads and decodes:
apple-touch-icon;rel=icon;/favicon.ico.It's stored as a 256×256 PNG; SVG-only sites get none.
Determinism: the same fetched bytes give the same result. The HTML and logo sha256 are stored as provenance.
POST /v1/tenants/{id}/branding/derive("Neu ermitteln", tenants.write):derive_state: failedwith the reason.derive_disabledwhile switched off, and 409 for demo workspaces.Background:
RunBrandingderives up to 5 per minute.manualin the same statement.Audit:
branding.derived(domain, colour source, logo yes/no, forced) andbranding.failed(domain, reason). Logs carry the tenant id only, not the domain.Switches (both off by default)
BRANDING_DERIVE=on: the endpoint, the queueing and the worker.BRANDING_BACKFILL=on: queues every customer workspace without branding once at start.Tests
internal/branding, against a TLS test server:PublicIPtable,PickDomain, colour parsing and the tie rule.TestBrandingDeriveon Memory and Postgres:no_domain.🤖 Generated with Claude Code
Replaced by #159: same code on a fresh branch from main. This branch carried a merge commit whose subject failed commitlint, and a force-push wasn't an option.
Pull request closed