@bongos/core 1.19.428 → 1.19.430

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.bongos-core.json +69 -44
  2. package/clients/bongos-client/index.d.ts +4 -4
  3. package/docs/adr/0214-canonical-profile-url-one-resolver-dark-until-the-page-exists.md +90 -0
  4. package/docs/adr/README.md +1 -0
  5. package/docs/api/openapi.json +13 -2
  6. package/docs/api-reference.md +1 -1
  7. package/docs/copy-inventory.md +137 -128
  8. package/docs/copy-registry.json +248 -166
  9. package/docs/design/mocks/hub/picker.html +421 -0
  10. package/docs/design/projects-hub-direction-v2.md +22 -0
  11. package/docs/file-map.md +2 -1
  12. package/docs/module-api-changelog.md +4 -0
  13. package/modules/hall-ui/public/profile-canonical.js +137 -0
  14. package/modules/hall-ui/public/profile-connections.js +20 -9
  15. package/modules/hall-ui/public/profile.html +9 -0
  16. package/modules/hall-ui/public/profile.js +5 -0
  17. package/modules/platform-identity/canonical-profile.js +143 -0
  18. package/modules/platform-identity/routes/projects.js +24 -0
  19. package/modules/platform-identity/routes/sso.js +7 -0
  20. package/modules/provisioning/module.json +1 -1
  21. package/modules/provisioning/provisioning.js +63 -2
  22. package/modules/provisioning/routes/provisioning.js +28 -6
  23. package/modules/provisioning/tests/provisioning.mjs +34 -0
  24. package/modules/ui-design/kit/fixtures/featured-hub.json +1 -1
  25. package/modules/ui-design/kit/fixtures/featured.json +1 -1
  26. package/modules/ui-design/kit/fixtures/provisioning-instances.json +1 -1
  27. package/modules/ui-design/kit/serve.js +28 -4
  28. package/package-lock.json +2 -2
  29. package/package.json +1 -1
  30. package/public-landing/assets/cosmos.css +37 -0
  31. package/public-landing/projects.html +164 -5
  32. package/public-landing/projects.probes.json +12 -0
  33. package/public-landing/projects.states.json +3 -2
  34. package/src/bongos/routes/builders.js +24 -2
  35. package/src/bongos/serve-internal.js +28 -2
  36. package/src/module-api.js +1 -1
  37. package/tests/canonical_profile_url.mjs +628 -0
  38. package/tests/profile_connections_ui.mjs +38 -0
  39. package/tests/profile_route.mjs +30 -5
  40. package/tests/projects_hub.mjs +122 -7
  41. package/tests/provisioning_settings.mjs +81 -2
  42. package/tests/provisioning_settings_env.mjs +6 -0
@@ -41,6 +41,7 @@ const { attachFail } = require('./middleware/error-envelope');
41
41
  const metrics = require('./metrics');
42
42
  const { logger } = require('./logger');
43
43
  const gdsAuth = require('./auth');
44
+ const { loadIdpConfig } = require('./auth-config');
44
45
  const { buildStampedHtml } = require('../asset-version');
45
46
  const { buildInfo } = require('../build-info');
46
47
  const { buildDevboxDownloads } = require('../devbox-downloads');
@@ -164,7 +165,7 @@ function injectBrandingGlobal(html, brand = clientBranding(), mods = clientModul
164
165
  // fill cannot reach them, and a baked one would make every instance advertise
165
166
  // whichever instance happened to author the file (task 1002748, direction C5/C6).
166
167
  // Pure + exported for the test; both origins are injectable so it drives with zero I/O.
167
- function applyBrandTokens(html, brand = clientBranding(), origin = safePublicOrigin(), hallOrigin = safeBuildersOrigin(), sourceRepo = safeSourceRepoUrl(), instanceBase = safeInstanceBase()) {
168
+ function applyBrandTokens(html, brand = clientBranding(), origin = safePublicOrigin(), hallOrigin = safeBuildersOrigin(), sourceRepo = safeSourceRepoUrl(), instanceBase = safeInstanceBase(), hubOrigin = safeHubOrigin()) {
168
169
  const world = (brand.identity && brand.identity.worldName) || '';
169
170
  const product = (brand.identity && brand.identity.productName) || '';
170
171
  const tagline = (brand.copy && brand.copy.tagline) || '';
@@ -182,7 +183,13 @@ function applyBrandTokens(html, brand = clientBranding(), origin = safePublicOri
182
183
  // whichever instance authored the file
183
184
  .split('{{buildersOrigin}}').join(esc(hall))
184
185
  .split('{{sourceRepoUrl}}').join(esc(sourceRepo || ''))
185
- .split('{{instanceBase}}').join(esc(instanceBase || ''));
186
+ .split('{{instanceBase}}').join(esc(instanceBase || ''))
187
+ // The PLATFORM HUB's apex — where a builder's canonical cross-project
188
+ // profile lives (P08, task 1002804 / ADR 0214 D2). Empty on a vanilla
189
+ // instance, and a page that reads it MUST render nothing rather than fall
190
+ // back: never write this token straight into an href, because an empty
191
+ // value would leave a same-host relative URL claiming to be the hub.
192
+ .split('{{hubOrigin}}').join(esc(hubOrigin || ''));
186
193
  }
187
194
  // A link whose href is a BARE origin token that resolves empty is dropped whole,
188
195
  // server-side (task 1003242; the branding contract): a pack that names no domains
@@ -231,6 +238,25 @@ function safeBuildersOrigin() {
231
238
  function safeInstanceBase() {
232
239
  try { return branding().domains.instanceBase || ''; } catch { return ''; }
233
240
  }
241
+ // The PLATFORM HUB's apex — the origin a builder's canonical cross-project
242
+ // profile is addressed on (P08, task 1002804; ADR 0171 D1 named this gap, ADR
243
+ // 0214 D2 fills it). Three cases, in the order they are asked:
244
+ // * THIS instance IS the hub — `platform-identity` enabled is the hub flag
245
+ // itself (src/platform-server.js), not a proxy for it — so the hub apex is
246
+ // its own publicOrigin;
247
+ // * a FEDERATED instance — the hub it signs in through, from the same
248
+ // `<PREFIX>_HUB_ORIGIN` env that auth-config's loadIdpConfig resolves; there
249
+ // is no second source of truth for "which hub am I on";
250
+ // * a VANILLA instance — no hub, so '' and every consumer renders nothing.
251
+ // Best-effort like its four siblings above: a branding or env hiccup must resolve
252
+ // to "no hub", never break every served page.
253
+ function safeHubOrigin() {
254
+ try {
255
+ if (isModuleEnabled('platform-identity')) return safePublicOrigin();
256
+ const idp = loadIdpConfig();
257
+ return (idp && idp.origin) || '';
258
+ } catch { return ''; }
259
+ }
234
260
  // The instance's own source repo, from the pack's `repo: {owner, name}` binding —
235
261
  // another server-only field (the branding contract keeps repo off clientBranding
236
262
  // alongside domains). A page that wants to link "read the source" must take it
package/src/module-api.js CHANGED
@@ -33,7 +33,7 @@ const { validateOrRespond, LIMITS, parseId, asyncHandler, corsPublicGet, parsePa
33
33
  // there. scripts/gds/bump-version.js still rewrites the literal below; it appends
34
34
  // the entry to that file. Look for a version's history there, not here.
35
35
  // ---------------------------------------------------------------------------
36
- const CORE_VERSION = '1.19.428'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
36
+ const CORE_VERSION = '1.19.430'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
37
37
 
38
38
  // A namespaced logger so a module's log lines are attributable + consistent.
39
39
  // Usage: const log = api.logger('dev-box'); log.info('mounted');