Service Keys page polish + per-instance key-count column - #5472
Merged
norman-abramovitz merged 6 commits intoJun 17, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six commits on one branch, two related threads of Service Keys work.
Service Keys page
/serviceswall. The row action now tags the keys nav with?breadcrumbs=cf|space-servicesand 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 fromapplication-tabs-base.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
?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 gateis green: 2639 frontend unit tests pass, the production build is clean, and the Go test suite passes.