BCH-1345: Leverage tab for browsing/subscribing to published export offerings - #281
Conversation
…export offerings Lets a downstream SSP owner browse published export offerings from the cross-SSP catalog (title/description/version/item summary only — never anything upstream-scoped) and subscribe via a wizard: pick items to inherit, mark which upstream responsibilities the downstream will satisfy, and supply leveraged-authorization details. Wired to BCH-1338's subscribe endpoint. Subscribe is gated on both ssp-export-offering:subscribe and ssp:update (on the current/downstream SSP) via nested PermissionGates, mirroring the API's own dual check and never touching ssp:read on the upstream SSP.
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an SSP Leverage page that retrieves catalog offerings, displays subscription actions under permission gates, and opens a wizard to submit selected items, responsibilities, and leveraged authorization details. ChangesSSP leverage subscription
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant LeverageView
participant CatalogAPI
participant SubscribeOfferingWizard
participant AuthenticatedAxios
User->>LeverageView: Open Leverage tab
LeverageView->>CatalogAPI: Fetch catalog offerings
CatalogAPI-->>LeverageView: Return offerings
User->>LeverageView: Select Subscribe
LeverageView->>SubscribeOfferingWizard: Open selected offering
User->>SubscribeOfferingWizard: Select items and enter authorization
SubscribeOfferingWizard->>AuthenticatedAxios: POST subscription request
AuthenticatedAxios-->>SubscribeOfferingWizard: Return leverage links
SubscribeOfferingWizard-->>LeverageView: Emit subscribed event
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/system-security-plans/SubscribeOfferingWizard.vue`:
- Around line 175-205: Prevent re-entry in submit() by returning immediately
when submitting.value is already true, before performing validation or
constructing the request. Preserve the existing submitting state lifecycle for
the initial submission.
In
`@src/views/system-security-plans/__tests__/SystemSecurityPlanLeverageView.spec.ts`:
- Line 147: Move the regular expression used by the expectation in
SystemSecurityPlanLeverageView.spec.ts to module scope, then reuse that
module-level constant in the not.toMatch assertion to satisfy
e18e/prefer-static-regex.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c064f8d4-fb45-4af2-925d-e66e236e8caf
📒 Files selected for processing (8)
src/components/system-security-plans/SubscribeOfferingWizard.vuesrc/constants/permissions.tssrc/router/index.tssrc/types/ssp-export-offerings.tssrc/types/ssp-leverage.tssrc/views/system-security-plans/SystemSecurityPlanEditorView.vuesrc/views/system-security-plans/SystemSecurityPlanLeverageView.vuesrc/views/system-security-plans/__tests__/SystemSecurityPlanLeverageView.spec.ts
… regex Guard SubscribeOfferingWizard's submit() against concurrent submissions, and hoist the upstream-scoped-path regex in the leverage view spec to module scope to satisfy e18e/prefer-static-regex.
Summary
GET /oscal/ssp-export-offerings) — title, description, version, and an item-count summary. Never surfaces anything upstream-scoped (no upstream SSP name/metadata is available in the catalog response by design, and this view never fetches one).POST /oscal/ssp-export-offerings/:id/subscribe(BCH-1338).ssp-export-offering:subscribeandssp:update(on the current/downstream SSP) via nestedPermissionGates — mirroring the API's own dual server-side check, which also never evaluatesssp:readon the upstream SSP anywhere in the path.SUBSCRIBEpermission action constant, andCatalogOffering/CatalogOfferingItem/SSPLeverageLink/SubscribeRequesttypes matching the API's actual JSON shapes.Test plan
vue-tsc --buildclean (project-wide, including test files)eslintcleanSystemSecurityPlanLeverageView.spec.ts): offering list rendering, empty state, a dedicated trust-boundary test asserting the only URL ever fetched is the flat catalog endpoint, full subscribe round-trip (payload shape + success toast), blocked submit with zero items selected, and gating on either/both permissionsnpm run test:unitsuite green aside from one pre-existing, unrelatedLoginView.spec.tsfailure (localStorageenv issue predating this change)fullSummary by CodeRabbit
New Features
Tests