Repository navigation
refactor (bbb-web): Allow getJoinUrl parameters for non-moderators - #22943
antobinary merged 2 commits into
Conversation
WalkthroughThe pull request adds a new private property 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
Suggested reviewers
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.javaTip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 updateThe 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 permissionsThe 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
getJoinUrlendpoint.bigbluebutton-web/grails-app/conf/spring/resources.xml (1)
212-212: Properly configured Spring bean propertyThe new property is correctly added to the
paramsProcessorUtilbean, 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 defaultsThe new configuration property is thoroughly documented with clear explanations of:
- Its purpose (blocking specific userdata parameters for non-moderators)
- That restrictions apply only to viewers, with moderators retaining full access
- How to block all userdata parameters (using the "all" value)
- 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 variableThe addition of this private member variable follows the class's established pattern for storing configuration values.
967-969: Properly implemented getter methodThe getter method follows Java Bean conventions and is consistent with the pattern used for other properties in this class.
1700-1702: Properly implemented setter methodThe 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:
- Always allowing the
enforceLayoutparameter (which is needed for mobile apps)- 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.
| 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]) } | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify proper handling of edge cases.
The implementation looks solid, but consider these edge cases:
- What happens if
getGetJoinUrlUserdataBlocklist()returns null or an empty string? - 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 groovyLength 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 aNullPointerException. - If it returns an empty string, the resulting list will contain a single empty element, which might lead to unintended behavior downstream.
- If it returns
-
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.
- Null Check/Default Value: Add an explicit null check or provide a default value (e.g., an empty string) before calling
Automated tests Summary✅ All the CI tests have passed! |
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.



Currently, only moderators can pass parameters when calling the
getJoinUrlendpoint. However, this limitation poses issues in certain cases:joinUrlwith theenforceLayoutparameter to display only the whiteboard.userdata-parameters to control layout traits or behavior.To address these scenarios while maintaining meeting security, we’ve introduced a new config option:
getJoinUrlUserdataBlocklistinbigbluebutton.properties.This config defines which
userdata-parameters should be blocked when the user is not a moderator. By default, the followinguserdata-parameters are blocked:bbb_record_permissionbbb_record_videobbb_fullaudio_bridgebbb_transparent_listen_onlybbb_multi_user_pen_onlybbb_presenter_toolsbbb_multi_user_toolsYou can customize the blocklist as needed. Setting the value to
allblocks alluserdata-parameters.This solution was discussed and agreed upon with @lfzawacki.