Skip to content

CS-413 [BUG] SoA shows "unavailable" to auditor account#2925

Merged
tofikwest merged 12 commits into
mainfrom
chas/soa-as-auditor
Jun 3, 2026
Merged

CS-413 [BUG] SoA shows "unavailable" to auditor account#2925
tofikwest merged 12 commits into
mainfrom
chas/soa-as-auditor

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 25, 2026

This is an automated pull request to merge chas/soa-as-auditor into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Allow auditors to view the Statement of Applicability without creating data by adding a read‑only get-setup API and using it when the user lacks audit:create (CS-413). Enforces ISO 27001-only support, passes the trusted org ID to the service, and shows a permission-aware empty state when setup is missing.

  • New Features
    • API: POST /v1/soa/get-setup (audit:read) returns existing configuration/document (or null) without creating; validates ISO 27001 only and includes latest answers; uses trusted organizationId.
    • App: Chooses ensure-setup for creators and get-setup for auditors across the overview card, framework tabs, and SSR page; shows a role-aware empty state instead of a spinner when not set up.

Written for commit 9c6b0a3. Summary will update on new commits.

Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jun 3, 2026 2:15pm
comp-framework-editor Ready Ready Preview, Comment Jun 3, 2026 2:15pm
portal Ready Ready Preview, Comment Jun 3, 2026 2:15pm

Request Review

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/soa-as-auditor CS-413 [BUG] SoA shows "unavailable" to auditor account May 25, 2026
@linear
Copy link
Copy Markdown

linear Bot commented May 25, 2026

CS-413

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Confidence score: 2/5

  • There is a concrete security/authorization risk: ensure-setup in apps/api/src/soa/soa.controller.ts can create SOA records while only requiring audit:read, which permits mutation under a read-level scope.
  • Given the high severity (7/10) and high confidence (9/10), this is likely user-impacting and raises regression risk if merged without tightening permissions for the endpoint.
  • Pay close attention to apps/api/src/soa/soa.controller.ts - align endpoint authorization with write/create behavior to avoid privilege escalation.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/soa/soa.controller.ts Outdated
@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 25, 2026

@cubic-dev-ai please review it

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 8 files

Confidence score: 2/5

  • There is a high-risk tenant isolation issue in apps/api/src/soa/soa.controller.ts: trusting organizationId from the request body instead of enforcing @OrganizationId() can allow cross-tenant access/update behavior.
  • apps/app/src/app/(app)/[orgId]/documents/statement-of-applicability/components/SOAFrameworkTabs.tsx also has a user-facing regression risk where getSOASetup can leave tabs stuck in a perpetual loading spinner when setup is missing or fetch fails.
  • Given the high severity (8/10) and high confidence (9/10) on the API scoping issue, this is not quite safe to merge without fixes.
  • Pay close attention to apps/api/src/soa/soa.controller.ts, apps/app/src/app/(app)/[orgId]/documents/statement-of-applicability/components/SOAFrameworkTabs.tsx - enforce tenant scoping in the controller and ensure loading/error fallback exits spinner state.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/soa/soa.controller.ts
@vercel vercel Bot temporarily deployed to Preview – app May 26, 2026 17:07 Inactive
@vercel vercel Bot temporarily deployed to Preview – portal May 26, 2026 17:07 Inactive
@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai Ultrareview

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 2, 2026

@cubic-dev-ai Ultrareview

@chasprowebdev Ultrareview monthly budget exhausted (12/12 used). Budget resets at the start of next month.

@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai Ultrareview

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 2, 2026

@cubic-dev-ai Ultrareview

@chasprowebdev Ultrareview monthly budget exhausted (12/12 used). Budget resets at the start of next month.

@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 2, 2026

@cubic-dev-ai please review it

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest
Copy link
Copy Markdown
Contributor

@cubic-dev-ai review it

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Jun 3, 2026

@cubic-dev-ai review it

@tofikwest I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit ce14a42 into main Jun 3, 2026
11 checks passed
@tofikwest tofikwest deleted the chas/soa-as-auditor branch June 3, 2026 14:44
@tofikwest
Copy link
Copy Markdown
Contributor

approved

@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.69.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants