Skip to content

refactor (bbb-web): Allow getJoinUrl parameters for non-moderators - #22943

Merged
antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
gustavotrott:getjoinurl-viewers-params
Apr 25, 2025
Merged

antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
gustavotrott:getjoinurl-viewers-params

Conversation

@gustavotrott

Copy link
Copy Markdown
Contributor

Currently, only moderators can pass parameters when calling the getJoinUrl endpoint. However, this limitation poses issues in certain cases:

  • Mobile App (Whiteboard in iframe): The app requests the joinUrl with the enforceLayout parameter to display only the whiteboard.
  • Plugins (e.g., hybrid rooms, remote-camera): These may need to define a specific layout or pass userdata- parameters to control layout traits or behavior.

To address these scenarios while maintaining meeting security, we’ve introduced a new config option:
getJoinUrlUserdataBlocklist in bigbluebutton.properties.

This config defines which userdata- parameters should be blocked when the user is not a moderator. By default, the following userdata- parameters are blocked:

  • bbb_record_permission
  • bbb_record_video
  • bbb_fullaudio_bridge
  • bbb_transparent_listen_only
  • bbb_multi_user_pen_only
  • bbb_presenter_tools
  • bbb_multi_user_tools

You can customize the blocklist as needed. Setting the value to all blocks all userdata- parameters.

This solution was discussed and agreed upon with @lfzawacki.

@gustavotrott gustavotrott added this to the Release 3.0 milestone Apr 14, 2025
@gustavotrott
gustavotrott requested a review from lfzawacki April 14, 2025 14:32
@coderabbitai

coderabbitai Bot commented Apr 14, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The pull request adds a new private property getJoinUrlUserdataBlocklist to the ParamsProcessorUtil class along with its getter and setter methods. It also introduces a corresponding configuration property in the bigbluebutton.properties file and adds the property to a Spring bean in the resources.xml file. In the ApiController, the parameter processing logic for the getJoinUrl API call is modified to filter out userdata- parameters based on the blocklist when the user is a viewer. Moderators continue to have the permission to pass any parameter. Additionally, the documentation is updated to reference the new configuration property and to clarify the adjustments in the API behavior.

Sequence Diagram(s)

sequenceDiagram
    participant U as User/Client
    participant C as API Controller
    participant P as ParamsProcessorUtil

    U->>C: Request getJoinUrl
    C->>P: getGetJoinUrlUserdataBlocklist()
    P-->>C: Return blocklistData
    alt User is Moderator
        C->>C: Process parameters (no blocklist filtering)
    else User is Viewer
        C->>C: Filter userdata parameters using blocklistData
    end
    C->>U: Return getJoinUrl response
Loading

Suggested reviewers

  • antonbsa

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.

🔧 ast-grep (0.31.1)
bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 cb5085f and 75f39bc.

📒 Files selected for processing (6)
  • bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java (3 hunks)
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1 hunks)
  • bigbluebutton-web/grails-app/conf/spring/resources.xml (1 hunks)
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (1 hunks)
  • docs/docs/data/getJoinUrl.tsx (1 hunks)
  • docs/docs/development/api.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-package (bbb-web)
🔇 Additional comments (10)
docs/docs/data/getJoinUrl.tsx (1)

38-43: Excellent documentation update

The addition of this sentence provides clear information to administrators about the new configuration option. It effectively explains where to find and configure the blocked parameters list for viewers.

docs/docs/development/api.md (1)

1258-1262: Correctly updated API description for broader permissions

The change from "Moderators" to "Users" accurately reflects the new behavior, indicating that all users (not just moderators) can now customize session parameters. This is consistent with the PR objective of allowing non-moderators to pass parameters to the getJoinUrl endpoint.

bigbluebutton-web/grails-app/conf/spring/resources.xml (1)

212-212: Properly configured Spring bean property

The new property is correctly added to the paramsProcessorUtil bean, following the established pattern used for other configuration properties. This enables the Spring framework to inject the value from the properties file.

bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1)

536-540: Well-documented configuration property with secure defaults

The new configuration property is thoroughly documented with clear explanations of:

  1. Its purpose (blocking specific userdata parameters for non-moderators)
  2. That restrictions apply only to viewers, with moderators retaining full access
  3. How to block all userdata parameters (using the "all" value)
  4. A sensible default list of security-sensitive parameters to block

The default configuration provides a good balance between flexibility and security.

bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java (3)

153-153: Appropriate addition of private member variable

The addition of this private member variable follows the class's established pattern for storing configuration values.


967-969: Properly implemented getter method

The getter method follows Java Bean conventions and is consistent with the pattern used for other properties in this class.


1700-1702: Properly implemented setter method

The setter method follows Java Bean conventions and is consistent with the pattern used for other properties in this class. This enables Spring to inject the configuration value from the properties file.

bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (3)

1224-1225: New parameter blocklist implementation looks good.

This code correctly retrieves the userdata parameters that should be blocked for non-moderators from the configuration and splits them into a list.


1226-1228: Effective use of flags for permission control.

The implementation properly checks if the user is a moderator and creates a flag to block all userdata parameters if the blocklist contains "all". This provides good flexibility for administrators to control parameter access.


1229-1246: Parameter filtering logic is well-structured.

The implementation creates a clear separation of concerns by:

  1. Always allowing the enforceLayout parameter (which is needed for mobile apps)
  2. Applying special rules for parameters with the userdata- prefix based on:
    • Moderator status (moderators can pass any parameters)
    • The blocklist configuration (admins can control which parameters are blocked)

This satisfies the PR objective of allowing non-moderators to pass specific parameters while maintaining security.

Comment on lines +1224 to 1246
List<String> userdataBlocklistForViewers=Arrays.asList(paramsProcessorUtil.getGetJoinUrlUserdataBlocklist().split(","));

boolean isModerator = us.role?.equals(ROLE_MODERATOR);
boolean blockAllUserdataForViewers = userdataBlocklistForViewers.any { it.equalsIgnoreCase("all") };

if (!meeting.isBreakout()) {
request.getParameterMap()
.findAll { key, value -> ["enforceLayout"].contains(key) || key.startsWith("userdata-") }
.findAll { key, value ->
// always allow `enforceLayout`
if (key == "enforceLayout") return true

// For prefix userdata-
if (key.startsWith("userdata-")) {
if (isModerator) return true
if (blockAllUserdataForViewers) return false
return !userdataBlocklistForViewers.contains(key - "userdata-")
}

return false
}
.findAll { key, value -> !StringUtils.isEmpty(value[-1]) }
.each { key, value -> queryParameters.put(key, value[-1]) };
.each { key, value -> queryParameters.put(key, value[-1]) }
}

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

Verify proper handling of edge cases.

The implementation looks solid, but consider these edge cases:

  1. What happens if getGetJoinUrlUserdataBlocklist() returns null or an empty string?
  2. Are there any performance concerns with processing the blocklist for each request?

🏁 Script executed:

#!/bin/bash
# Check for null handling in ParamsProcessorUtil class
rg -A 5 "getGetJoinUrlUserdataBlocklist" --type groovy

Length of output: 970


Critical Edge Case Handling for the Userdata Blocklist

  • The current implementation uses:

    List<String> userdataBlocklistForViewers = Arrays.asList(paramsProcessorUtil.getGetJoinUrlUserdataBlocklist().split(","));

    This approach assumes that getGetJoinUrlUserdataBlocklist() always returns a valid, non-null string. However:

    • If it returns null, calling .split(",") will throw a NullPointerException.
    • If it returns an empty string, the resulting list will contain a single empty element, which might lead to unintended behavior downstream.
  • Recommendations:

    • Null Check/Default Value: Add an explicit null check or provide a default value (e.g., an empty string) before calling split(",") to prevent runtime exceptions.
    • Empty String Handling: Ensure that the case of an empty string is deliberately handled, either by filtering out empty elements or by defining a clear behavior.
    • Performance Consideration: While processing the blocklist on every request likely has a minimal performance impact, consider caching or pre-processing the blocklist if the value doesn’t change often.

@github-actions

Copy link
Copy Markdown

Automated tests Summary

✅ All the CI tests have passed!

@antobinary
antobinary merged commit a0098fd into bigbluebutton:v3.0.x-release Apr 25, 2025
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Nov 5, 2026
getJoinUrl drops every userdata- parameter, for viewers and for everyone
in a breakout room, when the blocklist contains "all". bbb-web has
accepted that value since bigbluebutton#22943 (3.0.7), but the userdata section of
api.md only described the named entries.

The sentence is the one CodeRabbit suggested in the review of bigbluebutton#26428.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants