Skip to content

fix(people): address third round of cubic review findings#2891

Merged
Marfuen merged 1 commit into
mainfrom
mariano/cs-312-cubic-review-fixes-3
May 21, 2026
Merged

fix(people): address third round of cubic review findings#2891
Marfuen merged 1 commit into
mainfrom
mariano/cs-312-cubic-review-fixes-3

Conversation

@Marfuen
Copy link
Copy Markdown
Contributor

@Marfuen Marfuen commented May 21, 2026

Summary

Fixes all remaining Cubic findings from #2878 (third review pass), focusing on security hardening and edge cases:

Security (P1):

  • Guard all mutation endpoints against missing userId (API key/service token auth)
  • Validate memberId belongs to organizationId before revocation operations (cross-tenant prevention)
  • Change User onDelete from Cascade to SetNull on completions/revocations (preserve audit trail)
  • Guard uploadEmploymentEvidence against missing user context
  • Reject partial evidence payloads (require all 3 fields or none)

Bug fixes (P2):

  • Fix test mock: findUniquefindFirst for undoVendorRevocation
  • Validate provider date strings before Date conversion in sync controller
  • Add noopener,noreferrer to all window.open('_blank') calls
  • Disable "Attach evidence" button while row is processing
  • Handle API error state in OffboardingBanner

Test plan

  • Call offboarding endpoints with API key auth (no session) — should get 400, not crash
  • Attempt cross-tenant revocation — should get 404
  • Delete a user who completed offboarding items — completions should remain (completedById set to null)
  • Send partial evidence payload to revoke endpoint — should get 400
  • Sync employees with invalid date strings — should skip gracefully

🤖 Generated with Claude Code


Summary by cubic

Hardens offboarding and people flows to close the third round of Cubic review findings. Supports CS-312 by safely importing onboard dates from integrations and making evidence uploads reliable.

  • Bug Fixes
    • Require user context for all offboarding mutations and employment evidence uploads; return 400 if missing.
    • Validate memberId belongs to organizationId before any vendor revocation; return 404 on cross-tenant attempts.
    • Preserve audit trail by changing User FKs on completions/revocations to SetNull instead of Cascade.
    • Reject partial evidence payloads in revokeVendorAccess; fileName, fileType, and fileData must be provided together.
    • Only set onboardDate when provider date strings are valid in Google Workspace, Rippling, and JumpCloud imports.
    • UI safety: disable “Attach evidence” while processing, add noopener,noreferrer to exports, and hide OffboardingBanner on API error.

Written for commit 1eff642. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment May 21, 2026 2:51pm
comp-framework-editor Ready Ready Preview, Comment May 21, 2026 2:51pm
portal Ready Ready Preview, Comment May 21, 2026 2:51pm

Request Review

@linear
Copy link
Copy Markdown

linear Bot commented May 21, 2026

CS-312

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 21, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
CompAI 🟢 Ready View Preview May 21, 2026, 2:47 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

- fix test mock: findUnique → findFirst for undoVendorRevocation
- guard uploadEmploymentEvidence against missing userId in API key auth
- change User onDelete to SetNull on completions/revocations (preserve audit)
- add requireUserId helper to offboarding controller for all mutations
- validate member belongs to org before revocation operations
- validate provider date strings before converting to Date in sync
- reject partial evidence payloads in revokeVendorAccess
- add noopener,noreferrer to all window.open calls
- disable attach evidence button while processing
- handle error state explicitly in OffboardingBanner

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 11 files

Confidence score: 5/5

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

Re-trigger cubic

@Marfuen Marfuen merged commit 8ec5214 into main May 21, 2026
6 of 10 checks passed
@Marfuen Marfuen deleted the mariano/cs-312-cubic-review-fixes-3 branch May 21, 2026 14:48
claudfuen pushed a commit that referenced this pull request May 21, 2026
# [3.60.0](v3.59.2...v3.60.0) (2026-05-21)

### Bug Fixes

* **cloud-tests:** show meaningful Auto-Remediate diff for configure-only plans ([90c95f6](90c95f6))
* **evidence-export:** load automations one at a time to prevent OOM ([07f02e4](07f02e4))
* **people:** address cubic review findings for offboarding feature ([#2884](#2884)) ([9d43a6b](9d43a6b))
* **people:** address fifth round of cubic review findings ([#2893](#2893)) ([dbc364c](dbc364c))
* **people:** address fourth round of cubic review findings ([#2892](#2892)) ([ca9d9a5](ca9d9a5))
* **people:** address remaining cubic review findings for offboarding ([#2890](#2890)) ([8026352](8026352))
* **people:** address third round of cubic review findings ([#2891](#2891)) ([8ec5214](8ec5214))
* **people:** ds component compatibility fixes for offboarding UI ([200b112](200b112))
* **ui:** close MultipleSelector dropdown on blur so it stops blocking sibling form controls ([b9d08c8](b9d08c8))

### Features

* **api:** unblock cloud-tests mutations for API key + service token callers ([26e53da](26e53da))
* **cloud-tests:** add deterministic AWS plan normalizer for SLR params ([e0ec0f7](e0ec0f7))
* **cloud-tests:** fail fast on missing required AWS command params ([5f2d342](5f2d342))
* **cloud-tests:** universal AI step-repair on AWS validation errors ([8adf505](8adf505))
* **frameworks:** show controls as default tab with requirement column ([e41365d](e41365d))
* **people:** add employment events tracking and offboarding checklist ([5e15a73](5e15a73))
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.60.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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants