Skip to content

Service Keys page polish + per-instance key-count column - #5472

Merged
norman-abramovitz merged 6 commits into
cloudfoundry:developfrom
nabramovitz:cleanup-stratos-60172026
Jun 17, 2026
Merged

Service Keys page polish + per-instance key-count column#5472
norman-abramovitz merged 6 commits into
cloudfoundry:developfrom
nabramovitz:cleanup-stratos-60172026

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Six commits on one branch, two related threads of Service Keys work.

Service Keys page

  • E2E coverage for the V3 API: Handle new service_bindings endpoint #4301 keys page: six broker-dependent specs (page render, empty-or-list, default credential masking, add-form open/cancel, bindable gating). They skip when no managed instance is available and never print credential values.
  • Context-aware breadcrumbs. Opening Service Keys from a CF endpoint or space list previously popped the user out to the global /services wall. The row action now tags the keys nav with ?breadcrumbs=cf|space-services and the keys page builds the matching trail (endpoint Services tab, or the full endpoint - org - space trail back to the space's Service Instances tab) from the loaded instance plus the endpoint registry, using the existing keyed-breadcrumb convention from application-tabs-base.
  • Partial URL masking. Connection-string credentials (uri/jdbc_uri/read_uri) were masked whole, hiding the readable host/port/db along with the password. They now redact only the password run, e.g. postgres://user:<redacted>@host:5432/db; plain key-sensitive secrets stay fully masked. The copied value and the Show toggle still expose the real credential.

Per-instance Service Keys count

  • A "Service Keys" count column on every service-instance list: the offering Instances tab, the services wall, the CF space service-instances tab, and the CF services tab. Each cell is a whole-cell link to that instance's keys page and shows an em-dash until the count loads.
  • Counts are fetched lazily, one batched request per CNSI (?service_instance_guids=...), grouped by each binding's owning service instance, and cached in a signal the column reads. The fetch is idempotent (skips already-counted guids and in-flight CNSIs), tolerant (a failed request leaves the dash), skips user-provided instances, and uses an explicit method plus cache rather than a root-injector effect.

Developed test-first throughout. Full make check gate is green: 2639 frontend unit tests pass, the production build is clean, and the Go test suite passes.

Six broker-dependent tests for the per-instance Service Keys page:
page render, empty-state-or-list, default credential masking,
Add-key form open/cancel, and bindable-instance gating. Tests skip
when no managed instance is available and never print credential
values.
The Service Keys row action and the keys-page breadcrumb were both
hardcoded to the global /services wall, so opening Service Keys from a
CF endpoint or space list popped the user out of that CF navigation.

Thread an optional breadcrumb key through buildServiceInstanceRowActions
so CF-scoped lists tag the keys nav with ?breadcrumbs= (cf for the
endpoint Services tab, space-services for a space). The keys page now
builds one breadcrumb set per origin and lets PageHeader select by that
hint: default global wall, the endpoint Services tab, or the full
endpoint -> org -> space trail back to the space's Service Instances
tab. Trail labels/links come from the instance's space/organization
(summary tier) and the endpoint name from the registry.
Connection-string credentials (uri/jdbc_uri/read_uri) were masked whole,
hiding the readable host/port/db along with the password. Mask just the
password run in a scheme://user:pass@host value, e.g.
postgres://user:<redacted>@host:5432/db, while plain key-sensitive
secrets stay fully bulleted. The copied value and the Show reveal still
expose the real credential; only the hidden display changes.
ensureServiceKeyCounts() fetches each loaded managed instance's
service-key count in one batched GET per CNSI
(?service_instance_guids=...), groups the returned bindings by owning
instance, and caches guid -> count in a signal the list column reads.
Idempotent (skips counted guids + in-flight CNSIs), tolerant (a failed
fetch leaves '—'), skips user-provided instances, and clears on
re-scope. Explicit method + cache, no uncaptured root-injector effect.
renderServiceKeyCount(si, count) renders an em-dash for an unknown
count (distinct from a real 0) and the number otherwise; serviceKeysLink
targets the instance's keys page, or null for user-provided instances.
The count is passed in (not read off the row) so the column render stays
a pure, reactively re-invokable function. Mirrors bound-apps-cell.ts.
Add a whole-cell 'Service Keys' link column to the offering Instances
tab, the services wall, the CF space service-instances tab, and the CF
services tab. Each renders the lazy per-instance count (em-dash until
loaded) and links to that instance's keys page, and calls
ensureServiceKeyCounts() after its instances load. Placed right after
Attached Apps where that column exists; after Last Operation on the CF
services tab, which has no Attached Apps column.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norman-abramovitz
norman-abramovitz merged commit a89de54 into cloudfoundry:develop Jun 17, 2026
12 checks passed
@nabramovitz
nabramovitz deleted the cleanup-stratos-60172026 branch June 17, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants