fix: use allow-list in getConnectedApps to prevent accidental data leakage#29472
fix: use allow-list in getConnectedApps to prevent accidental data leakage#29472Bhavya-jain07 wants to merge 3 commits into
Conversation
|
Welcome to Cal.diy, @Bhavya-jain07! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe getConnectedApps utility removes an inline TODO and now constructs returned items by explicitly enumerating selected 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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: 1
🤖 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 `@packages/app-store/_utils/getConnectedApps.ts`:
- Around line 206-217: The returned allow-listed app object from
getConnectedApps is missing locationOption so the UI can't read
item?.locationOption?.value; update the object returned in the function (the
allow-list/mapper that currently returns slug, name, logo, categories, variant,
type, description, dirName, isGlobal, dependencies, extendsFeature, etc.) to
include locationOption: app.locationOption (safe because it's derived in
packages/app-store/utils.ts), ensuring you keep the existing conditional spreads
like ...(teams.length && { credentialOwner }) and ...(app.dependencies && {
dependencyData }) intact.
🪄 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: CHILL
Plan: Pro
Run ID: 0d0e0542-206a-487a-a56d-7500d0c61a5e
📒 Files selected for processing (1)
packages/app-store/_utils/getConnectedApps.ts
db523f4 to
a9b47fa
Compare
Replaces unsafe ...app spread with explicit allow-list. Resolves existing TODO comment. Fixes calcom#28923
a9b47fa to
2556978
Compare
|
@cla-assistant recheck |
|
Hi, all checks are passing and the CLA is signed. Could a maintainer please add the run-ci label and review when you get a chance? Thanks! |
What does this PR do?
Replaces the unsafe
...appspread ingetConnectedApps.tswith anexplicit allow-list of safe fields. This prevents any future internal
fields from being accidentally leaked to the frontend.
Why?
The existing code used a deny-list pattern (excluding
credentialsandkey) and then spread the rest via...app. A// TODOcomment inthe file already flagged this as a known issue.
Changes
packages/app-store/_utils/getConnectedApps.ts: replaced...appspread with an explicit field allow-list
Fixes #28923