Skip to content

feat: orgs conferencing apps #22211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

Conversation

SomayChauhan
Copy link
Member

@SomayChauhan SomayChauhan commented Jul 2, 2025

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Summary by cubic

Added organization-level conferencing app management, allowing org admins to connect, list, set default, and disconnect conferencing apps for the entire organization.

  • New Features
    • New API endpoints for managing conferencing apps at the organization level.
    • Updated frontend hooks and components to support organization-wide conferencing app actions.

@SomayChauhan SomayChauhan requested review from a team as code owners July 2, 2025 12:13
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Feat/orgs conferencing apps". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@graphite-app graphite-app bot requested a review from a team July 2, 2025 12:14
@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Jul 2, 2025
@dosubot dosubot bot added the ✨ feature New feature or request label Jul 2, 2025
Copy link

graphite-app bot commented Jul 2, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (07/02/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link

delve-auditor bot commented Jul 2, 2025

No security or compliance issues detected. Reviewed everything up to b270660.

Security Overview
  • 🔎 Scanned files: 34 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► atoms.conferencing-apps.controller.ts
    Add Organization Conferencing Apps List Endpoint
► conferencing-atom.service.ts
    Include Team Installed Apps Option
► conferencing.controller.ts
    Add Default Conferencing App with Credential ID
► organizations-conferencing.controller.ts
    Implement Organization Level Conferencing Apps
► organizations-teams-conferencing.controller.ts
    Implement Team Level Conferencing Apps
Refactor ► conferencing.repository.ts
    Update Team Conferencing Apps Query
► conferencing.service.ts
    Refactor Conferencing App Logic
► user.repository.ts
    Add Profile Skip Platform Check Method
Configuration changes ► package.json
    Update Platform Libraries Version

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

Copy link
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.

cubic found 9 issues across 22 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@@ -9,13 +9,15 @@ import http from "../../../lib/http";

export const QUERY_KEY = "get-installed-conferencing-apps";

export const useAtomsGetInstalledConferencingApps = (teamId?: number) => {
export const useAtomsGetInstalledConferencingApps = (teamId?: number, orgId?: number) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function signature now allows both teamId and orgId, but the logic does not handle the case where both are provided. This could lead to ambiguous or unintended API calls. Consider validating that only one of teamId or orgId is provided at a time.

@@ -61,6 +61,14 @@ export async function getLocationGroupedOptions(
id: userOrTeamId.userId,
},
});

if (user?.organizationId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

When the user belongs to an organization this branch replaces the previous { userId } filter with { teamId: { in: [user.organizationId] } }, causing personal credentials owned by the user to be ignored. As a result users who are part of an org will no longer see their own conferencing credentials in the location selector.

@@ -169,6 +169,21 @@ export class ConferencingController {
const fallbackUrl = decodedCallbackState.onErrorReturnTo || "";
return { url: fallbackUrl };
}
} else if (decodedCallbackState.orgId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This new branch repeats almost the same logic as the preceding team-level branch (building the same params / headers, performing the same axios call, and handling identical success & error flows). Copy-pasting this block increases maintenance cost and risks future inconsistencies. Extract the shared logic into a reusable helper instead of duplicating it.

Copy link

vercel bot commented Jul 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal ⬜️ Ignored Preview Aug 12, 2025 6:54am
cal-eu ⬜️ Ignored Preview Aug 12, 2025 6:54am

@vercel vercel bot temporarily deployed to Preview – api July 3, 2025 12:27 Inactive
@vercel vercel bot temporarily deployed to Preview – cal July 3, 2025 12:27 Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea31aa8 and 5c885f0.

📒 Files selected for processing (3)
  • packages/app-store/server.ts (2 hunks)
  • packages/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials.ts (1 hunks)
  • packages/features/eventtypes/components/Locations.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/app-store/server.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.

Files:

  • packages/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials.ts
  • packages/features/eventtypes/components/Locations.tsx
🧠 Learnings (1)
packages/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials.ts (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : Make sure the credential.key field is never returned back from tRPC endpoints or APIs.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (5)
packages/features/eventtypes/components/Locations.tsx (5)

76-89: LGTM! Function signature update handles credential filtering correctly.

The getLocationFromType function has been properly updated to accept an optional credentialId parameter and filters location options accordingly. The logic correctly falls back to type-only matching when no credentialId is provided.


272-272: LGTM! Credential-aware location retrieval.

The function call correctly passes the credentialId from the location field to enable proper filtering of location options.


283-286: LGTM! Enhanced option selection logic with credential awareness.

The isOptionSelected prop implementation correctly compares both value and credentialId (when present) to determine if an option is selected. The fallback logic for options without credentialId is appropriate.


303-306: LGTM! Improved location uniqueness validation.

The validation logic now correctly checks for uniqueness based on both type and credentialId, preventing duplicate locations with the same credential. This ensures proper handling of multiple credentials for the same location type.


550-553: LGTM! Consistent credential-aware selection logic.

The isOptionSelected implementation in the empty location select component matches the logic used in the main location fields, ensuring consistent behavior across the component.

Comment on lines +60 to 62
const { profile } = await new UserRepository(prisma).enrichUserWithItsProfileSkipPlatformCheck({
user: user,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Clarify the security implications of skipping the platform check.

The change from enrichUserWithItsProfile to enrichUserWithItsProfileSkipPlatformCheck suggests that some platform organization validation is being bypassed. Given that this function aggregates credentials from multiple sources (user, team, org) and returns service account keys, it's important to understand:

  1. What specific platform check is being skipped and why?
  2. Are there any security implications of bypassing this check in the context of credential aggregation?
  3. Is this change necessary for the organization-level conferencing app management feature?

Please verify the security implications and provide documentation on why the platform check bypass is safe in this context:


🏁 Script executed:

#!/bin/bash
# Search for the implementation of both methods to understand the difference
ast-grep --pattern $'enrichUserWithItsProfile($$$) {
  $$$
}'

ast-grep --pattern $'enrichUserWithItsProfileSkipPlatformCheck($$$) {
  $$$
}'

# Look for any security-related comments or documentation
rg -A 5 -B 5 "enrichUserWithItsProfileSkipPlatformCheck"

Length of output: 2277


Provide context & justification for skipping the platform check

The switch to enrichUserWithItsProfileSkipPlatformCheck (bypassing the platform-org validation) can inadvertently surface credentials from users in un-related orgs or expose service-account keys. Please:

  • Document exactly which validation is being skipped and why it’s safe here.
  • Add an inline comment in packages/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials.ts (at the call on line 60) referencing the user.ts doc for future maintainers.
  • Confirm via tests or code review that no unauthorized credentials can be returned by this change.

Tagging user.ts for reference:
packages/lib/server/repository/user.ts

/**
 * Similar to enrichUserWithItsProfile but skips the platform org check.
 * This function directly returns the profile without checking if it's a platform organization.
 */
async enrichUserWithItsProfileSkipPlatformCheck...
🤖 Prompt for AI Agents
In
packages/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials.ts
at line 60, add an inline comment explaining that
enrichUserWithItsProfileSkipPlatformCheck is used to bypass the platform
organization validation because in this context it is safe to do so, referencing
the detailed documentation in packages/lib/server/repository/user.ts. Clearly
state which validation is skipped and why it does not risk exposing unauthorized
credentials. Also, ensure through tests or code review that this change does not
allow retrieval of credentials from unrelated organizations or service accounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth core area: core, team members only ✨ feature New feature or request organizations area: organizations, orgs platform Anything related to our platform plan ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants