Repository navigation
feat: Allow per user logout url - #21204
gustavotrott merged 19 commits into
Conversation
|
Hey @jaapjansma, thanks for your contribution! Right now, the Basically, instead of passing the URL directly through the join call, your CRM would have a generic URL that gets called, receives a parameter with the user's ID in that application, and it knows what to do next. Do you think this approach would work for your use case? |
|
@gustavotrott the short answer is that we might get that working with a little workaround. The reason for that is that our CiviCRM runs in a private network (behind a firewall) and the follow up form is on a separate website. Your suggestion means that we have to implement something in between which looks up the use role and then redirect it to the desired location (which depends on whether the person has the role moderator). So ideally we provide this logout Url from our CiviCRM as soon as we create the meeting. I am also curious what @ffdixon would think? As he has written the original feature request. |
|
This pull request has conflicts ☹ |
WalkthroughThe changes involve the introduction of a Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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: 6
🧹 Outside diff range and nitpick comments (13)
bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (2)
23-23: LGTM! Consider encapsulation for future refactoring.The new
logoutUrlfield is correctly declared asfinal, which is good for immutability. Its declaration is consistent with other fields in the class.For future refactoring, consider using private fields with getter methods to improve encapsulation. This would allow for better control over data access and modification.
23-23: Overall impact: Feature implemented as requested. Consider additional system changes.The changes successfully implement the per-user logout URL feature as requested in the PR objectives. The implementation is consistent with the existing code structure and allows for flexibility in specifying logout URLs for different users.
Consider the following points for a complete implementation:
- Ensure that the
logoutUrlis properly used in the logout process, possibly in the meeting controller or a related service.- Update any relevant documentation or API specifications to reflect this new parameter.
- Consider adding validation for the
logoutUrlto ensure it's a valid URL.- If not already planned, implement changes in the front-end application to pass the
logoutUrlwhen registering users.Also applies to: 29-29, 45-45
bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (3)
16-16: LGTM: Constructor updated correctly with minor suggestion.The constructor has been properly updated to include the new
logoutUrlparameter, and the field is correctly initialized. This change maintains backward compatibility.Consider adding a null check for the
logoutUrlparameter to ensure it's not null before assigning it to the field. This can prevent potential NullPointerExceptions later:public RegisteredUser(String authToken, String userId, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby, String enforceLayout, String logoutUrl) { // ... other initializations ... - this.logoutUrl = logoutUrl; + this.logoutUrl = logoutUrl != null ? logoutUrl : ""; }Also applies to: 23-23
62-64: LGTM: Setter method forlogoutUrladded with suggestion for improvement.The
setLogoutUrl(String logoutUrl)method is properly implemented, following Java conventions for setter methods. It provides appropriate access to modify the privatelogoutUrlfield.Consider adding input validation to ensure that only valid URLs are set. This can prevent potential issues with invalid URLs later in the application. Here's a suggested implementation:
+import java.net.URL; +import java.net.MalformedURLException; public void setLogoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; + if (logoutUrl == null || logoutUrl.isEmpty()) { + this.logoutUrl = ""; + } else { + try { + new URL(logoutUrl); + this.logoutUrl = logoutUrl; + } catch (MalformedURLException e) { + throw new IllegalArgumentException("Invalid URL: " + logoutUrl, e); + } + } }This change ensures that only valid URLs are set, and throws an
IllegalArgumentExceptionfor invalid URLs, improving the robustness of the class.
Line range hint
1-78: Summary: Implementation successfully adds support for per-user logout URLs.The changes to the
RegisteredUserclass effectively implement the feature request for allowing per-user logout URLs. The newlogoutUrlfield, along with its getter and setter methods, provides the necessary functionality to manage individual logout URLs for each user.This implementation aligns well with the PR objectives and the requirements outlined in issue #20285. It offers a flexible solution that allows front-end applications to specify unique logout URLs for each user, addressing the limitations of the previous shared logout URL functionality.
The code maintains backward compatibility and follows good Java coding practices. With the suggested minor improvements for null checking and URL validation, this implementation will provide a robust solution for managing user-specific logout URLs in the Big Blue Button system.
To fully leverage this new feature:
- Ensure that the
logoutUrlis properly set when creatingRegisteredUserobjects in the relevant parts of the application.- Update the logout process to use the user-specific
logoutUrlwhen available, falling back to the default logout URL if not set.- Consider adding documentation or comments in the class to explain the purpose and usage of the
logoutUrlfield, especially noting any constraints on the URL format or protocol.bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml (1)
167-167: LGTM! Consider adding a comment for clarity.The addition of
logoutUrlto theselect_permissionsfor thebbb_clientrole is appropriate and aligns with the PR objectives. It allows clients to access the custom logout URL while maintaining security by not exposing it to clients not in a meeting.Consider adding a brief comment above the
logoutUrlfield to explain its purpose and any specific considerations. This can help future maintainers understand the intent behind this addition. For example:# Custom logout URL for redirecting users based on their role - logoutUrlakka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (2)
10-10: LGTM! Consider improving parameter alignment for readability.The addition of the
logoutUrlparameter to thecreatemethod and its inclusion in theRegisteredUserconstructor aligns well with the PR objective of allowing per-user logout URLs. The implementation is correct and consistent with the existing code style.To improve readability, consider aligning the parameters vertically:
def create( meetingId: String, userId: String, extId: String, name: String, roles: String, authToken: String, sessionToken: String, avatar: String, webcamBackground: String, color: String, guest: Boolean, authenticated: Boolean, guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String, logoutUrl: String, userMetadata: Map[String, String], loggedOut: Boolean ): RegisteredUser = { // ... (rest of the method body) }This formatting can make the method signature easier to read and maintain, especially as more parameters are added.
Also applies to: 35-35
Line range hint
1-261: Summary: Implementation successfully addresses PR objectivesThe changes made to the
RegisteredUsersobject andRegisteredUsercase class effectively implement the per-user logout URL feature as described in the PR objectives. The newlogoutUrlparameter has been correctly added to thecreatemethod and integrated into theRegisteredUsercase class.These modifications align well with the requirement to allow unique logout URLs for each user, which was the main goal of this PR. The implementation should enable the desired functionality of directing moderators and viewers to different logout pages based on their roles.
To fully realize the benefits of this feature:
- Ensure that the
logoutUrlis properly utilized in the relevant API endpoints or controllers that handle user logout.- Update the documentation to reflect this new capability, especially for integrators like CiviCRM users.
- Consider adding unit tests to verify the correct handling of the new
logoutUrlparameter.As this feature introduces a new level of flexibility in user management, it's important to ensure that:
- The
logoutUrlis properly sanitized and validated before use to prevent potential security issues like open redirects.- There's a fallback mechanism in place in case a custom
logoutUrlis not provided or is invalid.- The feature is documented clearly for administrators and integrators, explaining how to use and manage per-user logout URLs effectively.
These considerations will help ensure the feature is both powerful and secure in its implementation.
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (1)
291-291: LGTM! Consider adding parameter documentation.The addition of the
logoutUrlparameter to theregisterUsermethod successfully implements the per-user logout URL feature. This change aligns well with the PR objectives.However, to improve code maintainability and clarity, consider adding a brief comment or ScalaDoc to explain the purpose and expected format of the
logoutUrlparameter.Add a comment above the method signature explaining the
logoutUrlparameter:/** * @param logoutUrl The URL to redirect the user to upon logout. If not provided, the default logout URL will be used. */ def registerUser(meetingId: String, intUserId: String, name: String, role: String, extUserId: String, authToken: String, sessionToken: String, avatarURL: String, webcamBackgroundURL: String, guest: java.lang.Boolean, authed: java.lang.Boolean, guestStatus: String, excludeFromDashboard: java.lang.Boolean, enforceLayout: String, logoutUrl: String, userMetadata: java.util.Map[String, String]): Unit = { // ... (existing implementation) }Also applies to: 300-301
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (1)
127-131: LGTM! Consider adding parameter documentation.The addition of the
logoutUrlparameter to theregisterUsermethod signature and its inclusion in thehandlemethod call are correct and align with the PR objective of allowing per-user logout URLs.Consider adding Javadoc comments for the new
logoutUrlparameter to improve code documentation:/** * @param logoutUrl The custom logout URL for the user */bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (1)
408-413: Enhance logout URL handlingThe changes introduce a more flexible approach to handling the logout URL:
- It retrieves the default logout URL from the
meetingobject.- If a logout URL is provided in the request parameters (using
ApiParams.LOGOUT_URL), it overrides the default.- A debug log statement is added to track the final logout URL.
These changes align with the PR objectives of allowing per-user logout URLs. However, there are a few points to consider:
- The
ApiParams.LOGOUT_URLconstant is not defined in this file. Ensure it's properly imported and defined.- The debug log message uses string concatenation, which can be inefficient for logging. Consider using parameterized logging.
Consider updating the debug log statement to use parameterized logging:
- log.debug "The following logout URL is present: " + logoutUrl + log.debug "The following logout URL is present: {}", logoutUrlThis change improves logging performance, especially when debug logging is disabled.
bbb-graphql-server/bbb_schema.sql (2)
285-285: LGTM! Consider adding an index for performance.The addition of the
logoutUrlcolumn to theusertable is appropriate and aligns with the PR objectives. Thevarchar(500)type is suitable for storing URLs.Consider adding an index on this column if you expect to query users by their logout URL frequently:
CREATE INDEX idx_user_logoutUrl ON "user"("meetingId", "logoutUrl");
Action Required: Update Functions and Triggers to Handle
logoutUrlThe
logoutUrlcolumn has been added to theusertable, but existing functions and triggers do not reference or handle this new field. To ensure data consistency and proper functionality:
Update Functions:
update_user_voice_voiceActivityAt_trigger_funcupdate_user_connectionStatus_trigger_funcupdate_user_reaction_trigger_funcupdate_chat_user_startedTypingAt_trigger_funcupdate_chatUser_clear_lastTypingAt_trigger_funcupdate_user_hasDrawPermissionOnCurrentPageupdate_user_presenter_trigger_funcins_upd_del_breakoutRoom_user_trigger_funcset_last_roomupdate_bkroom_isUserCurrentlyInRoom_trigger_functruncate_tablesUpdate Triggers:
update_user_voice_voiceActivityAt_triggerupdate_user_connectionStatus_triggerupdate_user_reaction_triggerinsert_user_reaction_triggerupdate_user_presenter_triggerupdate_bkroom_isUserCurrentlyInRoom_triggerEnsure that all functions and triggers that perform insertions or updates on the
usertable include handling for thelogoutUrlcolumn. This may involve setting default values, updating existing records, and ensuring that business logic accounts for the new field.🔗 Analysis chain
Line range hint
285-427: Consider reviewing related functions and triggers.While the changes to add the
logoutUrlcolumn and include it in the view are well-implemented, it's worth considering if any existing functions or triggers in the schema need to be updated to handle this new column. For example, if there are any functions that insert or update user records, they might need to be modified to include thelogoutUrlfield.To help identify any potential areas that might need updating, you can run the following script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for functions or triggers that reference the user table echo "Functions referencing the user table:" rg --type sql -i 'CREATE\s+(OR\s+REPLACE\s+)?FUNCTION.*user' -A 10 echo "\nTriggers on the user table:" rg --type sql -i 'CREATE\s+TRIGGER.*ON\s+(")?user(")?'Length of output: 10857
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (21)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1 hunks)
- akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (1 hunks)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1 hunks)
- bbb-graphql-server/bbb_schema.sql (2 hunks)
- bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml (1 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (6 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/queries.ts (2 hunks)
- bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (3 hunks)
✅ Files skipped from review due to trivial changes (1)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala
🔇 Additional comments (28)
bigbluebutton-html5/imports/ui/components/meeting-ended/queries.ts (3)
6-6: Approved:logoutUrlmoved touser_currentobjectThis change aligns well with the PR objective of allowing per-user logout URLs. Moving
logoutUrlfrom themeetingobject to theuser_currentobject enables the system to handle unique logout URLs for each user, which is exactly what was requested in the original feature request (issue #20285).
25-25: Approved: GraphQL query updated to fetchlogoutUrlfor each userThe addition of
logoutUrlto theuser_currentselection set in thegetMeetingEndDataGraphQL query is crucial for implementing the per-user logout URL feature. This change ensures that the client receives the correct logout URL for each user, enabling the desired functionality of directing users to different logout pages based on their roles or other criteria.
Line range hint
1-43: Verify integration with other componentsThe changes made to the
MeetingEndDataResponseinterface andgetMeetingEndDataGraphQL query provide a solid foundation for implementing per-user logout URLs. However, to ensure full functionality:
- Verify that the server-side implementation sets the user-specific
logoutUrlwhen users join a meeting.- Check if any client-side components that previously used
meeting.logoutUrlhave been updated to useuser_current.logoutUrl.- Confirm that the documentation (mentioned in PR #21205) accurately reflects these changes.
To help with this verification, you can run the following script:
This script will help identify any areas that might need attention due to the
logoutUrlrelocation.✅ Verification successful
Verification Complete: No Issues Found
The updates to the
MeetingEndDataResponseinterface andgetMeetingEndDataGraphQL query have been correctly implemented. All instances ofmeeting.logoutUrlhave been removed, and thelogoutUrlassignments in the components are properly set.
- No remaining instances of
meeting.logoutUrldetected.logoutUrlis correctly assigned in relevant components.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for potential places that might need updates due to the logoutUrl change # Test 1: Check for any remaining instances of meeting.logoutUrl echo "Checking for remaining instances of meeting.logoutUrl:" rg --type typescript --type javascript 'meeting\.logoutUrl' # Test 2: Check for new instances of user_current.logoutUrl echo "Checking for new instances of user_current.logoutUrl:" rg --type typescript --type javascript 'user_current\.logoutUrl' # Test 3: Look for potential places where logoutUrl is set on the server side echo "Checking for potential server-side logoutUrl settings:" rg --type typescript --type javascript 'logoutUrl.*='Length of output: 644
Script:
#!/bin/bash # Description: Corrected script to check for potential places that might need updates due to the logoutUrl change # Test 1: Check for any remaining instances of meeting.logoutUrl in TypeScript and JavaScript files echo "Checking for remaining instances of meeting.logoutUrl:" rg --type ts --type tsx --type javascript 'meeting\.logoutUrl' # Test 2: Check for new instances of user_current.logoutUrl in TypeScript and JavaScript files echo "Checking for new instances of user_current.logoutUrl:" rg --type ts --type tsx --type javascript 'user_current\.logoutUrl' # Test 3: Look for potential places where logoutUrl is set on the server side in TypeScript and JavaScript files echo "Checking for potential server-side logoutUrl settings:" rg --type ts --type tsx --type javascript 'logoutUrl\s*='Length of output: 633
Script:
#!/bin/bash # Description: Updated script to check for potential places that might need updates due to the logoutUrl change # Test 1: Check for any remaining instances of meeting.logoutUrl in TypeScript, TSX, and JavaScript files echo "Checking for remaining instances of meeting.logoutUrl:" rg --type ts --type typescriptreact --type javascript 'meeting\.logoutUrl' # Test 2: Check for new instances of user_current.logoutUrl in TypeScript, TSX, and JavaScript files echo "Checking for new instances of user_current.logoutUrl:" rg --type ts --type typescriptreact --type javascript 'user_current\.logoutUrl' # Test 3: Look for potential places where logoutUrl is set on the server side in TypeScript, TSX, and JavaScript files echo "Checking for potential server-side logoutUrl settings:" rg --type ts --type typescriptreact --type javascript 'logoutUrl\s*='Length of output: 705
Script:
#!/bin/bash # Description: Updated script to check for potential places that might need updates due to the logoutUrl change using glob patterns # Test 1: Check for any remaining instances of meeting.logoutUrl in .ts, .tsx, and .js files echo "Checking for remaining instances of meeting.logoutUrl:" rg -g "*.ts" -g "*.tsx" -g "*.js" 'meeting\.logoutUrl' # Test 2: Check for new instances of user_current.logoutUrl in .ts, .tsx, and .js files echo "Checking for new instances of user_current.logoutUrl:" rg -g "*.ts" -g "*.tsx" -g "*.js" 'user_current\.logoutUrl' # Test 3: Look for potential places where logoutUrl is set on the server side in .ts, .tsx, and .js files echo "Checking for potential server-side logoutUrl settings:" rg -g "*.ts" -g "*.tsx" -g "*.js" 'logoutUrl\s*='Length of output: 1039
bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1)
26-26: LGTM! Verify implementations and update documentation.The addition of the
logoutUrlparameter to theregisterUsermethod signature aligns well with the PR objectives to allow per-user logout URLs. This change enhances the flexibility of the system as requested.To ensure the change is properly implemented, please run the following script to check for classes implementing this interface:
Consider updating the method's documentation to reflect the new
logoutUrlparameter. This will help maintain clear and up-to-date documentation for developers using this interface.bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (1)
29-29: LGTM! Verify impact on existing code.The constructor has been correctly updated to include the new
logoutUrlparameter, and the field is properly initialized. The changes maintain the existing structure and style of the constructor.To ensure that this change doesn't break existing code, we should verify that all calls to this constructor have been updated. Run the following script to check for any usages of the old constructor signature:
Also applies to: 45-45
✅ Verification successful
Verification Successful
All existing usages of the
RegisterUserconstructor have been updated to include the newlogoutUrlparameter. No issues were found during the verification process.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find usages of RegisterUser constructor that might need updating # Test: Search for RegisterUser constructor calls rg --type java -A 5 'new RegisterUser\s*\('Length of output: 802
bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1)
33-33: LGTM! The change aligns with the PR objectives.The addition of the
logoutUrlparameter to theRegisterUserReqMsgBodyconstructor is consistent with the PR's goal of allowing per-user logout URLs. This change enables the system to pass individual logout URLs for each user during registration.Let's verify the consistency of this change across the codebase:
This script will help us ensure that:
- All calls to
RegisterUserReqMsgBodyinclude thelogoutUrlparameter.- The
RegisterUsercase class includes thelogoutUrlfield.- Any handlers for
RegisterUserReqMsgare updated to handle the new parameter.Please review the results of this script to confirm the consistency of the change across the codebase.
✅ Verification successful
Verification Successful:
logoutUrlParameter Consistently ImplementedThe addition of the
logoutUrlparameter to theRegisterUserReqMsgBodyconstructor has been consistently applied across the codebase. All constructor calls and related message handlers have been appropriately updated to handle the new parameter, ensuring alignment with the PR objectives.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for consistency of the logoutUrl parameter across the codebase # Test 1: Search for RegisterUserReqMsgBody constructor calls echo "Searching for RegisterUserReqMsgBody constructor calls:" rg --type scala "RegisterUserReqMsgBody\(" -A 10 # Test 2: Search for RegisterUser case class definition echo "Searching for RegisterUser case class definition:" rg --type scala "case class RegisterUser" # Test 3: Search for logoutUrl parameter in related message handlers echo "Searching for logoutUrl parameter in related message handlers:" rg --type scala "def handle.*RegisterUserReqMsg"Length of output: 6341
bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (2)
13-13: LGTM: New fieldlogoutUrladded correctly.The addition of the
logoutUrlfield aligns with the PR objectives and follows good encapsulation practices by being declared as private.
58-60: LGTM: Getter method forlogoutUrladded correctly.The
getLogoutUrl()method is properly implemented, following Java conventions for getter methods. It provides appropriate access to the privatelogoutUrlfield.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (1)
37-37: Verify the implementation of thelogoutURLparameterThe addition of an empty string parameter to the
RegisteredUsers.createmethod call aligns with the PR objective of adding alogoutURLparameter. However, there are some concerns:
- The PR mentions adding a
logoutURLparameter, but the implementation uses an empty string.- It's unclear if this empty string is intended to be a placeholder for the
logoutURL.Please confirm if this implementation aligns with the PR objectives. If it does:
- Consider replacing the empty string with a meaningful parameter name or value for
logoutURL.- Update the method signature and any related documentation to reflect this change.
If this is not the intended implementation for the
logoutURLfeature, please revise the code to accurately reflect the PR objectives.To verify the
RegisteredUsers.createmethod signature, you can run the following script:This will help ensure that the method signature matches the updated call site.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (2)
Line range hint
1-124: Verify consistent usage of logoutUrl across the system.While the change is minimal and focused, it's important to ensure that the addition of
logoutUrlis consistently handled across the system. This includes checking if any other components or methods need to be updated to work with or pass along this new parameter.Please run the following script to check for other occurrences of
logoutUrlin the codebase:✅ Verification successful
Consistent usage of
logoutUrlconfirmed across the system.
The search results indicate thatlogoutUrlis consistently used in multiple components of the codebase. The addition inRegisterUserReqMsgHdlr.scalaaligns with existing implementations, ensuring uniform handling without introducing conflicts.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other occurrences of logoutUrl in the codebase # Test: Search for logoutUrl usage rg --type scala --type java 'logoutUrl'Length of output: 7552
63-63: LGTM! Verify RegisteredUsers.create method signature.The addition of
msg.body.logoutUrlto theRegisteredUsers.createmethod call aligns with the PR objectives of adding alogoutURLparameter. The implementation looks correct.Please run the following script to verify that the
RegisteredUsers.createmethod signature has been updated to accept the newlogoutUrlparameter:akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (4)
27-27: LGTM: Addition oflogoutUrlfieldThe addition of the
logoutUrlfield to theUserDbModelcase class aligns with the PR objectives. The default value of an empty string is appropriate, allowing for easy identification of custom logout URLs.
35-35: LGTM: Updates toUserDbTableDefclassThe changes to the
UserDbTableDefclass are consistent with the addition of thelogoutUrlfield:
- The
*projection is correctly updated to include the new field.- A new column definition for
logoutUrlis added with the correct type (String).These changes ensure proper mapping between the database table and the
UserDbModelcase class.Also applies to: 57-57
88-89: LGTM: Update toUserDAO.insertmethodThe addition of
logoutUrl = regUser.logoutUrlto theUserDbModelcreation in theinsertmethod is correct and consistent with the changes made to theUserDbModelcase class. This ensures that the per-user logout URL is properly stored in the database when inserting a new user.
27-27: Summary: Implementation of per-user logout URLThe changes in this file successfully implement the foundation for per-user logout URLs by adding the
logoutUrlfield to theUserDbModel, updating theUserDbTableDef, and modifying theUserDAO.insertmethod. These changes align well with the PR objectives.However, to fully implement this feature, consider the following suggestions:
- Ensure that the
logoutUrlis being used appropriately in the logout process.- Update any relevant API endpoints or services that handle user logout to utilize this new field.
- Consider adding validation for the
logoutUrlfield to ensure it's a valid URL.- Update documentation to reflect this new feature and how it should be used.
To verify the complete implementation of this feature, you may want to check other parts of the codebase that handle user logout. Here's a script to help identify potential areas that might need updates:
This script will help identify areas of the codebase that might need to be updated to fully implement the per-user logout URL feature.
Also applies to: 35-35, 57-57, 88-89
✅ Verification successful
Summary: Implementation of per-user logout URL Verified
The verification process confirms that the
logoutUrlfield has been successfully integrated throughout the codebase. The updated shell script identified all relevant usages in the code and confirmed that no additional configuration files require modifications.No further actions are needed to fully implement this feature.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find potential areas in the codebase that might need updates for the new logoutUrl feature # Search for logout-related code echo "Searching for logout-related code:" rg --type scala --type java "logout|logoutUrl" -g '!**/UserDAO.scala' # Search for API endpoints that might need to be updated echo "\nSearching for potential API endpoints to update:" rg --type scala --type java "def.*logout" -g '!**/UserDAO.scala' # Search for configuration related to logout URLs echo "\nSearching for logout URL configuration:" rg --type scala --type java --type conf "logoutUrl|logout.*url" -g '!**/UserDAO.scala'Length of output: 9270
Script:
#!/bin/bash # Description: Find potential areas in the codebase that might need updates for the new logoutUrl feature # Search for logout-related code echo "Searching for logout-related code:" rg --type scala --type java "logout|logoutUrl" -g '!**/UserDAO.scala' # Search for potential API endpoints to update echo "\nSearching for potential API endpoints to update:" rg --type scala --type java "def.*logout" -g '!**/UserDAO.scala' # Search for configuration related to logout URLs echo "\nSearching for logout URL configuration:" rg "logoutUrl|logout.*url" -g '*.conf' -g '!**/UserDAO.scala'Length of output: 9216
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (1)
258-258: LGTM! Verify usage oflogoutUrlin related components.The addition of the
logoutUrlfield to theRegisteredUsercase class is correct and consistent with the changes made in thecreatemethod. This change successfully implements the per-user logout URL feature.To ensure the new
logoutUrlfield is properly utilized, please verify its usage in related components:This verification will help ensure that the
logoutUrlis properly integrated into the system and used as intended in API endpoints or controllers.✅ Verification successful
Verified the usage of
logoutUrlacross related components.All instances of
logoutUrlhave been appropriately integrated within the system, ensuring consistent functionality across relevant components.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of logoutUrl in related components # Test: Search for logoutUrl usage in Scala files echo "Searching for logoutUrl usage in Scala files:" rg --type scala 'logoutUrl' # Test: Search for logoutUrl in API-related files echo "Searching for logoutUrl in API-related files:" rg --type scala 'logoutUrl' | rg -i 'api|endpoint|controller'Length of output: 5049
bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (4)
181-181: LGTM: Addition oflogoutUrltoMeetingEndedPropsThe addition of the
logoutUrlproperty to theMeetingEndedPropsinterface is correct and aligns with the PR objectives. This change enables the component to receive a custom logout URL for each user.
194-194: LGTM:logoutUrladded toMeetingEndedcomponent propsThe
logoutUrlprop has been correctly added to the destructured props of theMeetingEndedcomponent. This change is consistent with theMeetingEndedPropsinterface modification and allows the component to receive the custom logout URL.
Line range hint
1-516: Summary: Implementation of per-user logout URLThe changes introduced in this file successfully implement the per-user logout URL feature as described in the PR objectives. The
logoutUrlproperty has been added to the necessary interfaces and components, allowing for custom logout URLs to be passed down and used within theMeetingEndedcomponent.Key points:
- The
MeetingEndedPropsinterface has been updated to includelogoutUrl.- The
MeetingEndedcomponent now acceptslogoutUrlas a prop.- The
MeetingEndedContainerpasses thelogoutUrltoMeetingEndedin all render scenarios (loading, error, and success).To ensure the implementation is complete, please verify the following:
- Check that the
logoutUrlis being used correctly in the redirection logic within theMeetingEndedcomponent:#!/bin/bash # Check for the usage of logoutUrl in redirection logic grep -n 'window.location.href = logoutUrl' bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx
- Verify that the
logoutUrlis being properly populated in the GraphQL query result:#!/bin/bash # Check for the logoutUrl in the GraphQL query grep -n 'logoutUrl' bigbluebutton-html5/imports/ui/components/meeting-ended/queries.tsThese verifications will ensure that the
logoutUrlis not only passed correctly but also used appropriately in the component logic and properly fetched from the backend.
454-454: LGTM:logoutUrladded toMeetingEndedin loading stateThe
logoutUrlprop has been correctly added to theMeetingEndedcomponent within the loading state render ofMeetingEndedContainer. The empty string default value is appropriate for this state.Please ensure that a similar update has been made for the error state render. You can verify this by running the following command:
If the output shows two occurrences (one for loading and one for error state), then the change has been consistently applied.
✅ Verification successful
Verified:
logoutUrlcorrectly added to both loading and error states inMeetingEndedcomponentThe
logoutUrlprop has been consistently added to both the loading (line 454) and error (line 472) state renders of theMeetingEndedcomponent. This ensures consistency and adheres to the component's prop requirements.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if logoutUrl prop is present in both loading and error state renders grep -n 'logoutUrl=""' bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsxLength of output: 144
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (1)
291-291: Verify usage of registerUser method across the codebase.The signature change of the
registerUsermethod might affect other parts of the codebase that call this method.To ensure that all calls to
registerUserhave been updated correctly, run the following script:Please review the output to ensure all calls to
registerUserhave been updated to include thelogoutUrlparameter.Also applies to: 300-301
✅ Verification successful
All calls to
registerUserhave been verified and no issues were found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find all calls to registerUser method and verify they include the new logoutUrl parameter. # Search for method calls to registerUser rg --type scala "registerUser\s*\(" -A 10Length of output: 1692
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (2)
11-11: Verify implementation and documentationWhile the message structure change is correct, it's important to ensure that the rest of the system can handle and utilize this new
logoutUrlparameter effectively.
Please verify that the actual implementation of the custom logout URL functionality is present in the appropriate parts of the system (e.g., the component that handles user logout).
Check that the documentation update in the linked PR (#21205) accurately reflects this change and provides guidance on how to use the new
logoutUrlparameter.These steps will ensure that the feature is fully implemented and properly documented for users and developers.
11-11: LGTM! Verify usage in other parts of the system.The addition of the
logoutUrlparameter toRegisterUserReqMsgBodycorrectly implements the requested feature for allowing per-user logout URLs. This change aligns well with the PR objectives.To ensure this change doesn't break existing functionality, please verify all usages of
RegisterUserReqMsgBodyacross the codebase. Run the following script to find all occurrences:Make sure to update any code that constructs this case class to include the new
logoutUrlparameter.bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (1)
138-138: LGTM! Consistent implementation of the new feature.The inclusion of
logoutUrlin theRegisteredUserconstructor call is correct and consistent with the previous changes. This modification ensures that the custom logout URL is properly associated with the registered user.bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (3)
441-441: Update UserSession with new logoutUrlThe
UserSessionobject is now updated with the potentially customizedlogoutUrl. This change is crucial for implementing the per-user logout URL feature.
Line range hint
408-503: Summary of changes for per-user logout URL featureThe implemented changes successfully add support for per-user logout URLs in the
joinmethod of theApiController. Key modifications include:
- Retrieving the default logout URL from the meeting object.
- Allowing override of the logout URL through request parameters.
- Updating the
UserSessionobject with the custom logout URL.- Passing the logout URL to the
registerUsermethod of themeetingService.These changes align well with the PR objectives and provide the desired flexibility for handling different logout URLs based on user roles or entry paths.
To ensure full compatibility and proper implementation, please verify the following:
- The
ApiParams.LOGOUT_URLconstant is properly defined and imported.- The
registerUsermethod in themeetingServicehas been updated to handle the newlogoutUrlparameter.- Any downstream code that relies on the logout URL (e.g., actual logout handling) has been updated to use the new per-user logout URL.
Run the following script to check for potential usage of the logout URL in other parts of the codebase:
#!/bin/bash # Description: Check for logout URL usage in the codebase # Test: Find occurrences of logout URL handling rg --type groovy 'logoutUrl|logout.*URL' ./grails-appThis will help identify any areas that might need additional updates to fully support the new feature.
503-503: Pass logoutUrl to registerUser methodThe
logoutUrlis now passed as a parameter to theregisterUsermethod of themeetingService. This ensures that the custom logout URL is properly associated with the user's session.To ensure this change is properly integrated, we should verify that the
registerUsermethod in themeetingServicehas been updated to accept and handle this new parameter. Run the following script to check the method signature:bbb-graphql-server/bbb_schema.sql (1)
427-427: LGTM! The view update is consistent with the table change.The addition of the
logoutUrlfield to thev_user_currentview is appropriate and consistent with the change made to theusertable. This ensures that the logout URL is available when querying current user data through this view.
7d7bb92 to
d28496c
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (22)
bigbluebutton-html5/imports/ui/components/meeting-ended/queries.ts (1)
Ensure all usages of
getMeetingEndDataandlogoutUrlare correctly updatedThe shell script execution identified multiple instances of
getMeetingEndDataandlogoutUrlacross various components and services. Please verify that all these usages have been updated to align with the new structure introduced in the recent changes. This will help prevent potential inconsistencies or runtime errors.
bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsxbigbluebutton-html5/imports/startup/client/logger/ServerStream.tsbigbluebutton-html5/imports/ui/components/presence-adapter/component.tsxbigbluebutton-html5/imports/ui/components/join-handler/presenceManager/component.tsxbigbluebutton-html5/imports/ui/core/local-states/useAuthData.ts- (and others as identified by the script)
🔗 Analysis chain
Line range hint
1-43: Verify impact on dependent componentsThe changes to both the
MeetingEndDataResponseinterface and thegetMeetingEndDataGraphQL query are well-implemented and consistent. They successfully address the PR objectives by allowing per-user logout URLs, which will improve flexibility for different user roles (e.g., moderators and viewers).However, it's important to ensure that these changes don't negatively impact other parts of the application that may rely on the previous structure.
Please run the following script to identify potential areas that might be affected by this change:
Review the results to ensure that all occurrences are updated to use the new structure where
logoutUrlis part ofuser_currentinstead ofmeeting.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for usages of getMeetingEndData and logoutUrl in the codebase echo "Searching for usages of getMeetingEndData:" rg --type typescript --type javascript "getMeetingEndData" -A 5 echo "\nSearching for usages of logoutUrl:" rg --type typescript --type javascript "logoutUrl" -A 5Length of output: 367
Script:
#!/bin/bash # Description: Search for usages of getMeetingEndData and logoutUrl in the codebase echo "Searching for usages of getMeetingEndData:" rg --type ts --type tsx --type js --type jsx "getMeetingEndData" -A 5 echo "\nSearching for usages of logoutUrl:" rg --type ts --type tsx --type js --type jsx "logoutUrl" -A 5Length of output: 365
Script:
#!/bin/bash # Description: Search for usages of getMeetingEndData and logoutUrl in the codebase echo "Searching for usages of getMeetingEndData:" rg "getMeetingEndData" --glob "*.{ts,tsx,js,jsx}" -A 5 echo "\nSearching for usages of logoutUrl:" rg "logoutUrl" --glob "*.{ts,tsx,js,jsx}" -A 5Length of output: 21343
bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (1)
62-64: Consider adding input validation forsetLogoutUrl().The
setLogoutUrl()method is correctly implemented and follows Java conventions. However, consider adding input validation to ensure the provided URL is valid and meets any specific format requirements.Here's a suggestion for adding basic validation:
public void setLogoutUrl(String logoutUrl) { if (logoutUrl == null || logoutUrl.trim().isEmpty()) { throw new IllegalArgumentException("Logout URL cannot be null or empty"); } // You might want to add more specific URL validation here this.logoutUrl = logoutUrl; }bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1)
Line range hint
1-85: Summary of changes and next stepsThe modification to the
RegisterUsercase class aligns with the PR objectives to allow per-user logout URLs. This change enhances the flexibility of user redirection upon logout, as requested in the original feature request.To ensure a smooth integration of this change, please:
- Verify that all usages of
RegisterUseracross the codebase are updated to use the newlogoutUrlparameter instead ofsessionToken.- Review and update the
handleRegisterUsermethod implementation in this file to correctly process thelogoutUrlparameter.- Check for any remaining references to
sessionTokenthat might need to be replaced withlogoutUrl.- Ensure that the
logoutUrlis being properly utilized in the logout process.These steps will help maintain consistency and prevent potential issues related to this change.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (1)
26-26: LGTM! Consider using Option[String] for logoutUrl.The addition of
logoutUrlto theUserDbModelcase class aligns well with the PR objective of allowing per-user logout URLs. Good job on using an empty string as the default value to avoid null values.Consider using
Option[String]instead ofStringwith a default empty value. This would make it clearer when a logout URL is explicitly not set versus when it's an empty string. If you decide to make this change, remember to update related code accordingly.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (2)
10-10: LGTM! Consider adding documentation for the new parameter.The addition of the
logoutUrlparameter to thecreatemethod aligns well with the PR objectives. It allows for specifying a unique logout URL for each user, which is a key feature of this PR.Consider adding a brief comment explaining the purpose of the
logoutUrlparameter, especially since it's a new addition. This will help future developers understand its significance without needing to refer to external documentation.
272-272: LGTM! Consider adding a brief description for the new field.The addition of the
logoutUrlfield to theRegisteredUsercase class is consistent with the changes in thecreatemethod and aligns with the PR objectives.Consider adding a brief comment above the
logoutUrlfield to describe its purpose and any constraints (e.g., if it can be null or empty). This will enhance the self-documentation of the code and help maintain it in the future.bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (3)
Line range hint
272-276: ValidatelogoutUrlbefore redirectionWhile the usage of
logoutUrlfor redirection is correct, directly assigning it towindow.location.hrefwithout validation could pose a security risk. Consider implementing a URL validation function to ensurelogoutUrlis safe before redirection.Example validation:
const isValidUrl = (url: string): boolean => { try { new URL(url); return true; } catch { return false; } }; // Usage if (isValidUrl(logoutUrl)) { window.location.href = logoutUrl; } else { // Handle invalid URL (e.g., log error, use default URL) }
Line range hint
283-289: ValidatelogoutUrlafter placeholder replacementsThe placeholder replacements in
logoutUrlenhance functionality, but the resulting URL should be validated before use. Consider adding a validation step after the replacements:let redirectTo = logoutUrl; redirectTo = redirectTo.replaceAll('%%USERID%%', userId); redirectTo = redirectTo.replaceAll('%%USERNAME%%', userName); redirectTo = redirectTo.replaceAll('%%MEETINGID%%', meetingId); if (isValidUrl(redirectTo)) { window.location.href = redirectTo; } else { // Handle invalid URL (e.g., log error, use default URL) }This ensures that the final URL is safe to use for redirection.
454-454: LGTM:logoutUrlcorrectly added toMeetingEndedContainerThe
logoutUrlprop is correctly added to theMeetingEndedcomponent calls withinMeetingEndedContainer. The usage of an empty string as a fallback value in loading and error states is appropriate.Consider adding a comment explaining the source of
logoutUrlfor clarity:const { isModerator, logoutUrl, // Custom logout URL for the user meeting, } = user_current[0];This addition enhances code readability and documents the purpose of
logoutUrl.Also applies to: 472-472, 484-484, 512-512
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1)
11-11: LGTM! Consider adding a comment for thelogoutUrlparameter.The addition of the
logoutUrlparameter to theRegisterUserReqMsgBodycase class is correct and aligns with the PR objectives. This change enables the feature of specifying custom logout URLs for each user during registration.Consider adding a brief comment to describe the purpose of the
logoutUrlparameter, for example:case class RegisterUserReqMsgBody( // ... other parameters ... logoutUrl: String, // Custom URL to redirect the user upon logout userMetadata: Map[String, String] )This will improve code readability and make the purpose of the new parameter clear to other developers.
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (2)
127-127: LGTM! Consider adding@Nullableannotation.The addition of the
logoutUrlparameter to theregisterUsermethod signature is appropriate and aligns with the PR objective of allowing per-user logout URLs.Consider adding the
@Nullableannotation to thelogoutUrlparameter if it's not always required. This would improve code clarity and help prevent null pointer exceptions.
Line range hint
127-463: Summary: Per-user logout URL feature implemented correctlyThe changes in this file successfully implement the per-user logout URL feature as per the PR objectives. The
logoutUrlparameter has been consistently added to relevant method signatures and constructor calls. The implementation is minimal and focused, which is good for maintainability.Key points:
registerUsermethod signature updatedRegisterUserconstructor call updatedRegisteredUserconstructor call updatedprocessRegisterUsermethod call updatedTo ensure a complete implementation:
- Verify that the
RegisteredUserclass has been updated to include thelogoutUrlfield.- Confirm that the
gw.registerUsermethod in the gateway class handles the newlogoutUrlparameter.- Update unit tests to cover the new
logoutUrlfunctionality.- Consider adding documentation for the new parameter in the method JavaDoc comments.
bbb-graphql-server/bbb_schema.sql (10)
Line range hint
19-131: LGTM: Meeting tables are well-structured with appropriate relationships.The
meetingtable and its related tables (meeting_breakout,meeting_recordingPolicies, etc.) are well-designed with appropriate columns, constraints, and indexes. The use of generated columns forcreatedAtandendedin themeetingtable is a good practice for maintaining consistency.Consider adding a
CHECKconstraint to themeeting_recordingtable to ensure thatstoppedAtis always greater than or equal tostartedAt. This would prevent potential data inconsistencies:ALTER TABLE "meeting_recording" ADD CONSTRAINT "check_recording_times" CHECK ("stoppedAt" IS NULL OR "stoppedAt" >= "startedAt");
Line range hint
133-726: LGTM: User tables are comprehensive and well-structured.The
usertable and its related tables (user_voice,user_camera, etc.) are well-designed with appropriate columns, constraints, and indexes. The use of generated columns for derived properties is a good practice for maintaining consistency and improving query performance.Consider using an ENUM type for the
rolecolumn in theusertable instead of a varchar. This would provide better type safety and potentially improve performance. Here's how you could implement this:CREATE TYPE user_role AS ENUM ('MODERATOR', 'PRESENTER', 'VIEWER'); ALTER TABLE "user" ALTER COLUMN "role" TYPE user_role USING "role"::user_role;This change would ensure that only valid roles can be assigned to users and could potentially improve query performance when filtering by role.
Line range hint
728-1004: LGTM: Chat tables are well-structured with good use of triggers and views.The chat system, including the
chat,chat_user, andchat_messagetables, is well-designed. The use of triggers for updating typing status and message sequences is a good approach to maintain data consistency. The views provide useful abstractions for querying chat data efficiently.Consider adding a soft delete mechanism for chat messages instead of using a
deletedAttimestamp. This could be implemented by adding adeletedboolean column and updating the views to filter out deleted messages. Here's an example:ALTER TABLE "chat_message" ADD COLUMN "deleted" boolean NOT NULL DEFAULT false; CREATE INDEX "idx_chat_message_deleted" ON "chat_message"("deleted"); -- Update the v_chat_message_public view CREATE OR REPLACE VIEW "v_chat_message_public" AS SELECT cm.* FROM chat_message cm WHERE cm."chatId" = 'MAIN-PUBLIC-GROUP-CHAT' AND cm."deleted" = false; -- Update other views similarlyThis approach would allow for easier management of deleted messages and potentially improve query performance when fetching active messages.
Line range hint
1006-1330: LGTM: Presentation and annotation tables are well-structured with good use of triggers and views.The presentation system, including the
pres_presentation,pres_page, andpres_annotationtables, is well-designed. The use of triggers for updating user permissions is a good approach to maintain data consistency. The views provide useful abstractions for querying presentation data efficiently.For handling large presentations, consider implementing a pagination mechanism for fetching pages and annotations. This could be done by adding a
LIMITandOFFSETto the relevant views or by creating stored procedures. Here's an example for thev_pres_pageview:CREATE OR REPLACE FUNCTION get_presentation_pages( p_presentation_id VARCHAR(100), p_limit INTEGER, p_offset INTEGER ) RETURNS TABLE ( -- Include all columns from v_pres_page ) AS $$ BEGIN RETURN QUERY SELECT * FROM v_pres_page WHERE "presentationId" = p_presentation_id ORDER BY "num" LIMIT p_limit OFFSET p_offset; END; $$ LANGUAGE plpgsql;This approach would allow for more efficient fetching of large presentations, reducing the load on both the database and the application.
Line range hint
1332-1443: LGTM: Poll tables are well-structured with good use of views for data aggregation.The poll system, including the
poll,poll_option, andpoll_responsetables, is well-designed. The views provide useful abstractions for querying poll data and aggregating results efficiently.Consider adding a materialized view for poll results to improve performance for frequently accessed poll data, especially for polls with many responses. Here's an example:
CREATE MATERIALIZED VIEW "mv_poll_results" AS SELECT poll."meetingId", poll."pollId", poll."type", poll."questionText", poll."ownerId" AS "pollOwnerId", poll.published, o."optionId", o."optionDesc", count(r."optionId") AS "optionResponsesCount", sum(count(r."optionId")) OVER (partition by poll."pollId") "pollResponsesCount" FROM poll JOIN poll_option o ON o."pollId" = poll."pollId" LEFT JOIN poll_response r ON r."pollId" = poll."pollId" AND o."optionId" = r."optionId" GROUP BY poll."pollId", o."optionId", o."optionDesc" ORDER BY poll."pollId"; CREATE UNIQUE INDEX ON "mv_poll_results" ("pollId", "optionId"); -- Create a function to refresh the materialized view CREATE OR REPLACE FUNCTION refresh_poll_results() RETURNS TRIGGER AS $$ BEGIN REFRESH MATERIALIZED VIEW CONCURRENTLY "mv_poll_results"; RETURN NULL; END; $$ LANGUAGE plpgsql; -- Create triggers to refresh the materialized view CREATE TRIGGER refresh_poll_results_trigger AFTER INSERT OR UPDATE OR DELETE ON poll_response FOR EACH STATEMENT EXECUTE FUNCTION refresh_poll_results();This approach would significantly improve query performance for poll results, especially for polls with a large number of responses.
Line range hint
1445-1495: LGTM: External video and Screenshare tables are simple and effective.The
externalVideoandscreensharetables are well-structured for their purposes. The indexes and views, particularly those filtering for current (non-stopped) entries, are appropriate and useful.For long-running screenshares or external videos, consider implementing a heartbeat mechanism to ensure the sharing is still active. This could be done by adding a
lastHeartbeatAtcolumn and updating it periodically. Here's an example for thescreensharetable:ALTER TABLE "screenshare" ADD COLUMN "lastHeartbeatAt" timestamp with time zone; CREATE INDEX "idx_screenshare_heartbeat" ON "screenshare"("meetingId", "lastHeartbeatAt"); -- Update the view to include the heartbeat check CREATE OR REPLACE VIEW "v_screenshare" AS SELECT * FROM "screenshare" WHERE "stoppedAt" IS NULL AND ("lastHeartbeatAt" IS NULL OR "lastHeartbeatAt" > (NOW() - INTERVAL '1 minute')); -- Create a function to update the heartbeat CREATE OR REPLACE FUNCTION update_screenshare_heartbeat(p_screenshareId varchar(50)) RETURNS void AS $$ BEGIN UPDATE "screenshare" SET "lastHeartbeatAt" = NOW() WHERE "screenshareId" = p_screenshareId AND "stoppedAt" IS NULL; END; $$ LANGUAGE plpgsql;This approach would allow you to detect and handle stale screenshares or external videos that may have been disconnected unexpectedly.
Line range hint
1497-1533: LGTM: Timer table and view are well-designed for tracking meeting timers.The
timertable structure is comprehensive, allowing for both stopwatch and countdown functionalities. Thev_timerview provides useful derived properties based on the timer state, which is a good practice for encapsulating complex logic.To improve timer precision and handle potential time drift, consider using a combination of the database timestamp and the application server's time. You could add a column to store the offset between the server time and the database time when the timer starts. Here's an example:
ALTER TABLE "timer" ADD COLUMN "serverStartOffset" bigint; -- Update the view to include the offset in calculations CREATE OR REPLACE VIEW "v_timer" AS SELECT "meetingId", "stopwatch", CASE WHEN "stopwatch" IS TRUE OR "running" IS FALSE THEN "running" WHEN "startedAt" + (("time" - COALESCE("accumulated", 0)) * INTERVAL '1 millisecond') + ("serverStartOffset" * INTERVAL '1 millisecond') >= CURRENT_TIMESTAMP THEN TRUE ELSE FALSE END "running", -- ... (rest of the view definition) FROM "timer"; -- Create a function to start the timer with server offset CREATE OR REPLACE FUNCTION start_timer(p_meetingId varchar(100), p_serverTime bigint) RETURNS void AS $$ BEGIN UPDATE "timer" SET "startedOn" = EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000, "serverStartOffset" = p_serverTime - (EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000) WHERE "meetingId" = p_meetingId; END; $$ LANGUAGE plpgsql;This approach would help maintain timer accuracy even if there's a slight difference between the application server's time and the database server's time.
Line range hint
1535-1731: LGTM: Breakout room tables are well-structured with good use of triggers and views.The breakout room system, including the
breakoutRoomandbreakoutRoom_usertables, is well-designed. The use of triggers for updating user statuses and last assigned/joined rooms is a good approach to maintain data consistency. The views provide useful abstractions for querying breakout room data efficiently.For handling large numbers of breakout rooms, consider implementing a partitioning strategy for the
breakoutRoom_usertable. This could improve query performance when dealing with meetings that have many breakout rooms. Here's an example of how you could implement this:-- First, create a parent table CREATE TABLE "breakoutRoom_user_parent" ( "breakoutRoomId" varchar(100) NOT NULL, "meetingId" varchar(100), "userId" varchar(50), -- ... (other columns) CONSTRAINT "breakoutRoom_user_pkey" PRIMARY KEY ("breakoutRoomId", "meetingId", "userId") ) PARTITION BY HASH ("meetingId"); -- Create partitions CREATE TABLE "breakoutRoom_user_p0" PARTITION OF "breakoutRoom_user_parent" FOR VALUES WITH (MODULUS 4, REMAINDER 0); CREATE TABLE "breakoutRoom_user_p1" PARTITION OF "breakoutRoom_user_parent" FOR VALUES WITH (MODULUS 4, REMAINDER 1); CREATE TABLE "breakoutRoom_user_p2" PARTITION OF "breakoutRoom_user_parent" FOR VALUES WITH (MODULUS 4, REMAINDER 2); CREATE TABLE "breakoutRoom_user_p3" PARTITION OF "breakoutRoom_user_parent" FOR VALUES WITH (MODULUS 4, REMAINDER 3); -- Update the view to use the parent table CREATE OR REPLACE VIEW "v_breakoutRoom" AS SELECT -- ... (existing SELECT statement) FROM "user" u JOIN "breakoutRoom" b ON b."parentMeetingId" = u."meetingId" LEFT JOIN "breakoutRoom_user_parent" bu ON bu."meetingId" = u."meetingId" AND bu."userId" = u."userId" AND bu."breakoutRoomId" = b."breakoutRoomId" -- ... (rest of the view definition)This partitioning strategy would distribute the data across multiple tables based on the
meetingId, which could significantly improve query performance for large meetings with many breakout rooms.
Line range hint
1733-1893: LGTM: Shared notes and caption tables are well-structured with good use of triggers and views.The shared notes and caption systems, including the
sharedNotes,sharedNotes_rev,caption_locale, andcaptiontables, are well-designed. The use of triggers for updating caption locale information is a good approach to maintain data consistency. The views provide useful abstractions for querying shared notes and caption data efficiently.To improve real-time collaboration on shared notes, consider implementing a conflict resolution mechanism using a version vector or operational transformation approach. Here's an example of how you could modify the
sharedNotes_revtable to support this:ALTER TABLE "sharedNotes_rev" ADD COLUMN "parentRev" integer; ALTER TABLE "sharedNotes_rev" ADD COLUMN "conflictResolution" jsonb; -- Create a function to handle conflict resolution CREATE OR REPLACE FUNCTION resolve_shared_notes_conflict( p_meetingId varchar(100), p_sharedNotesExtId varchar(25), p_userId varchar(50), p_parentRev integer, p_changeset text, p_conflictResolution jsonb ) RETURNS integer AS $$ DECLARE new_rev integer; BEGIN -- Insert the new revision INSERT INTO "sharedNotes_rev" ("meetingId", "sharedNotesExtId", "userId", "parentRev", "changeset", "conflictResolution") VALUES (p_meetingId, p_sharedNotesExtId, p_userId, p_parentRev, p_changeset, p_conflictResolution) RETURNING "rev" INTO new_rev; -- Update the sharedNotes table with the latest revision UPDATE "sharedNotes" SET "lastRev" = new_rev WHERE "meetingId" = p_meetingId AND "sharedNotesExtId" = p_sharedNotesExtId; RETURN new_rev; END; $$ LANGUAGE plpgsql;This approach would allow for more sophisticated handling of concurrent edits, reducing the likelihood of conflicts and improving the user experience in real-time collaborative editing scenarios.
Line range hint
1895-2095: LGTM: Layout, notification, and plugin data channel tables are well-structured.The
layout,notification, andpluginDataChannelEntrytables are well-designed for their respective purposes. The use of JSON data types for plugin data provides flexibility, and the views offer useful abstractions for querying the data efficiently.To improve the handling of notifications, consider implementing a notification queue system that allows for better control over notification delivery and reduces the load on the main database. Here's an example of how you could modify the
notificationtable and add a queue table:-- Add a status column to the notification table ALTER TABLE "notification" ADD COLUMN "status" varchar(20) DEFAULT 'pending'; -- Create a notification queue table CREATE TABLE "notification_queue" ( "queueId" serial PRIMARY KEY, "notificationId" integer REFERENCES "notification"("notificationId"), "status" varchar(20) DEFAULT 'queued', "retryCount" integer DEFAULT 0, "nextRetryAt" timestamp with time zone, "createdAt" timestamp with time zone DEFAULT current_timestamp, "updatedAt" timestamp with time zone DEFAULT current_timestamp ); CREATE INDEX "idx_notification_queue_status" ON "notification_queue"("status", "nextRetryAt"); -- Create a function to enqueue notifications CREATE OR REPLACE FUNCTION enqueue_notification(p_notificationId integer) RETURNS void AS $$ BEGIN INSERT INTO "notification_queue" ("notificationId") VALUES (p_notificationId); END; $$ LANGUAGE plpgsql; -- Create a trigger to automatically enqueue new notifications CREATE TRIGGER "enqueue_notification_trigger" AFTER INSERT ON "notification" FOR EACH ROW EXECUTE FUNCTION enqueue_notification(NEW."notificationId");This approach would allow for better management of notification delivery, including retries and rate limiting, while reducing the load on the main database during high-traffic periods.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (20)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1 hunks)
- akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (1 hunks)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1 hunks)
- bbb-graphql-server/bbb_schema.sql (2 hunks)
- bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml (1 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (6 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/queries.ts (2 hunks)
🧰 Additional context used
🔇 Additional comments (32)
bigbluebutton-html5/imports/ui/components/meeting-ended/queries.ts (2)
6-6: LGTM: Interface update aligns with PR objectivesThe addition of the
logoutUrlfield to theuser_currentarray elements in theMeetingEndDataResponseinterface accurately reflects the PR's goal of implementing per-user logout URLs. This change enhances type safety and ensures consistency with the new feature.
25-25: LGTM: GraphQL query update maintains consistencyThe addition of the
logoutUrlfield to theuser_currentselection set in thegetMeetingEndDataquery ensures consistency with the updated interface. This change correctly implements the data fetching for the new per-user logout URL feature.bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1)
26-26: LGTM! ThelogoutUrlparameter has been added correctly.The addition of the
logoutUrlparameter to theregisterUsermethod signature aligns well with the PR objectives. This change enables the implementation of per-user logout URLs, which addresses the feature request described in issue #20285.A few points to consider:
- The placement of the new parameter is appropriate, coming before the
authedparameter.- Existing implementations of this interface will need to be updated to accommodate this new parameter.
- It might be helpful to add a brief Javadoc comment to explain the purpose of the
logoutUrlparameter.To ensure all implementations of this interface are updated, please run the following script:
bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (3)
23-23: LGTM: New fieldlogoutUrladded correctlyThe new
logoutUrlfield has been added with the appropriate modifiers (public final) and type (String). This is consistent with the other fields in the class and aligns with the PR objective of allowing per-user logout URLs.
29-29: LGTM: Constructor updated to includelogoutUrlThe constructor has been correctly updated to include the new
logoutUrlparameter. The parameter is added in the appropriate position in the constructor signature (line 29) and is properly assigned to the class field (line 45). This change ensures that thelogoutUrlcan be set when creating a newRegisterUserinstance.Also applies to: 45-45
23-23: Verify impact on existing codebaseWhile the changes to the
RegisterUserclass are correct, it's important to ensure that all parts of the codebase that use this class have been updated accordingly. Please verify the following:
- All calls to the
RegisterUserconstructor have been updated to include the newlogoutUrlparameter.- Any serialization/deserialization logic (e.g., JSON conversion) has been updated to handle the new
logoutUrlfield.- Unit tests have been updated or added to cover the new functionality.
To help with this verification, you can run the following script:
Please review the output of this script and make any necessary adjustments to the codebase.
Also applies to: 29-29, 45-45
bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1)
33-33: LGTM! VerifyRegisterUsermessage update.The addition of
logoutUrlto theRegisterUserReqMsgBodyconstructor aligns with the PR objective of allowing per-user logout URLs. This change correctly passes thelogoutUrlfrom theRegisterUsermessage to the Akka apps.To ensure full compatibility, please verify that the
RegisterUsermessage class has been updated to include thelogoutUrlfield. Run the following script to check:bbb-common-web/src/main/java/org/bigbluebutton/api/domain/RegisteredUser.java (4)
13-13: LGTM: New fieldlogoutUrladded correctly.The addition of the
logoutUrlfield aligns with the PR objectives and follows good encapsulation practices by being declared as private.
16-16: LGTM: Constructor updated correctly to includelogoutUrl.The constructor has been properly updated to include the new
logoutUrlparameter and initialize the corresponding field. The placement of the new parameter at the end of the parameter list maintains backward compatibility.Also applies to: 23-23
58-60: LGTM: Getter methodgetLogoutUrl()added correctly.The
getLogoutUrl()method follows Java conventions and correctly provides read access to thelogoutUrlfield.
Line range hint
1-78: Overall, the changes toRegisteredUser.javaare well-implemented.The addition of the
logoutUrlfield, along with its getter and setter methods, successfully implements the per-user logout URL functionality as described in the PR objectives. The changes follow Java conventions and maintain good encapsulation practices. The only suggestion for improvement is to add input validation in thesetLogoutUrl()method.bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1)
Line range hint
69-70: Review handleRegisterUser method implementationThe
handleRegisterUsermethod might need to be updated to handle the newlogoutUrlparameter. Please review its implementation to ensure it correctly processes thelogoutUrlinstead of the removedsessionToken.To assist with this review, please run the following script to display the content of the
handleRegisterUsermethod:#!/bin/bash # Description: Display the content of the handleRegisterUser method echo "Content of handleRegisterUser method:" rg --type scala -A 10 "def handleRegisterUser"Additionally, search for any usage of
RegisterUserin other parts of the codebase to ensure consistent updates:#!/bin/bash # Description: Search for RegisterUser usage in the codebase echo "Usage of RegisterUser in the codebase:" rg --type scala "RegisterUser\("Please review the results and make any necessary adjustments to maintain consistency with the new
logoutUrlparameter.akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (1)
21-21: Approve addition oflogoutURL, but suggest improvements for clarity and test coverage.The addition of the
logoutURLparameter (as an empty string) aligns with the PR objective. However, to enhance clarity and test coverage:
- Consider updating the
createRegisteredUsermethod signature to explicitly include thelogoutURLparameter:def createRegisteredUser(meetingId: String, users: RegisteredUsers, name: String, role: String, guest: Boolean, authed: Boolean, waitForApproval: Boolean, logoutURL: String = ""): RegisteredUser
Add test cases with non-empty
logoutURLvalues to ensure proper handling of the new parameter.Could you clarify the purpose of the second empty string parameter and the reason for removing the
Map()parameter? This information would help in understanding the full scope of the changes.To verify the impact of these changes, please run the following script:
This will help us understand how these changes might affect other parts of the codebase.
✅ Verification successful
Verified the addition of
logoutURLparameter and confirmed consistent usage across the codebase.The changes align with the PR objectives, and no issues were found in the current implementations. Proceed with the suggested improvements to enhance clarity and test coverage.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usages of RegisteredUsers.create and createRegisteredUser # Test: Search for RegisteredUsers.create usage echo "Searching for RegisteredUsers.create usage:" rg --type scala -A 5 'RegisteredUsers\.create' # Test: Search for createRegisteredUser usage echo "Searching for createRegisteredUser usage:" rg --type scala -A 5 'createRegisteredUser'Length of output: 4917
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (1)
37-37:⚠️ Potential issueVerify the impact of changing Map() to empty string in RegisteredUsers.create
The modification from
Map()to""for the last two parameters inRegisteredUsers.createaligns with the PR objective of allowing per-user logout URLs. However, this change raises some concerns:
- Changing from
Map()to""is a significant type change that could affect how user data is stored and retrieved in the system.- This modification might impact other parts of the codebase that expect these parameters to be of type
Map.Please verify that this change doesn't break existing functionality. Run the following script to check for other usages of
RegisteredUsers.createand ensure they are consistent with this change:Could you please clarify the rationale behind changing these parameters from
Map()to""? This will help ensure that the change is intentional and doesn't introduce any unintended side effects.bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml (1)
167-167: LGTM! Consider addinglogoutUrltobbb_client_not_in_meetingrole if needed.The addition of the
logoutUrlcolumn to thebbb_clientrole's select permissions is correct and aligns with the PR objectives. The placement and indentation are appropriate, maintaining the file's structure.Consider if the
logoutUrlshould also be added to thebbb_client_not_in_meetingrole's permissions. If users not in a meeting don't need access to this information, the current implementation is fine. Otherwise, you may want to add it to that role as well.To verify the current permissions, you can run the following command:
This will display the select permissions for both roles, allowing you to compare and ensure the
logoutUrlis present where needed.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (1)
63-63: LGTM! Verify usage oflogoutUrlin related components.The addition of
msg.body.logoutUrlto theRegisteredUsers.createmethod call correctly implements the per-user logout URL feature as intended in the PR objectives. This change allows for customized logout URLs for each user, which is particularly useful for scenarios where different user roles require different post-logout behaviors.To ensure the complete implementation of this feature, please verify:
- The
RegisteredUsers.createmethod correctly handles the newlogoutUrlparameter.- The logout process uses this custom URL when redirecting users.
Run the following script to check the implementation:
akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1)
61-61:⚠️ Potential issuePotential type mismatch and inconsistency with PR objectives
The change from
Map()to""for the second-to-last parameter ofRegisteredUsers.createseems inconsistent with the expected type and the PR objectives. This might lead to type mismatches or runtime errors. Additionally, this change doesn't align with the introduction of alogoutUrlparameter as mentioned in the PR objectives.Consider the following points:
- Is the empty string
""the correct type for this parameter? It was previouslyMap().- How does this change relate to the new
logoutUrlfeature mentioned in the PR objectives?- The AI-generated summary suggests that the last parameter was changed, but it's actually the second-to-last parameter that was modified.
To verify the correct usage of
RegisteredUsers.create, please run the following command:Could you please clarify the intention behind this change and ensure it aligns with the PR objectives?
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (3)
34-34: LGTM! Database schema updated correctly.The changes to the
UserDbTableDefclass correctly integrate the newlogoutUrlfield into the database table definition. The*projection and the column definition are both updated appropriately.Also applies to: 55-55
Line range hint
1-214: Overall, the changes look good and align with the PR objectives.The implementation of the
logoutUrlfield in theUserDbModel,UserDbTableDef, andUserDAO.insertmethod is consistent and appears to be complete for this file. The changes support the new feature of allowing per-user logout URLs as requested in the PR objectives.A few points to consider:
- The suggestion to use
Option[String]forlogoutUrlin theUserDbModelcase class.- Verifying that the
RegisteredUserclass has been updated accordingly in other files.- Ensuring that any other methods that create or update
UserDbModelinstances (if they exist) are also updated to handle the newlogoutUrlfield.Great job on implementing this feature!
85-86: LGTM! Verify RegisteredUser class update.The
insertmethod has been correctly updated to include thelogoutUrlwhen creating a newUserDbModel. This ensures that the logout URL is properly stored in the database for each user.To ensure full compatibility, let's verify that the
RegisteredUserclass has been updated to include thelogoutUrlfield:akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (2)
35-35: LGTM! Correct implementation of the new parameter.The
logoutUrlparameter is correctly added to theRegisteredUserconstructor call, maintaining consistency with the method signature changes. The placement of the parameter is appropriate and logical.
Line range hint
1-275: Overall implementation looks good. Minor documentation improvements suggested.The changes to add the
logoutUrlparameter to theRegisteredUsersobject andRegisteredUsercase class have been implemented correctly and consistently. These modifications align well with the PR objectives to allow per-user logout URLs.Key points:
- The
createmethod signature has been updated to include thelogoutUrlparameter.- The
RegisteredUserconstructor call within thecreatemethod now includes thelogoutUrlparameter.- The
RegisteredUsercase class has been updated to include thelogoutUrlfield.These changes provide the necessary structure to support unique logout URLs for each user, enhancing the flexibility of the system as requested in the original feature request.
To ensure that these changes are properly integrated and don't introduce any regressions, please run the following verification script:
This script will help identify any potential issues or inconsistencies in the implementation across the codebase.
✅ Verification successful
Verification Successful:
logoutUrlis consistently integrated with no outstanding issues detected.The
logoutUrlparameter has been appropriately integrated across the codebase, and no unresolved TODOs related to its functionality were found. The implementation aligns with the PR objectives, ensuring that each user can have a unique logout URL without introducing regressions.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of logoutUrl in the codebase # Check for any usages of logoutUrl in the codebase echo "Checking for usages of logoutUrl:" rg --type scala 'logoutUrl' # Check if there are any remaining TODOs related to logout URL functionality echo "Checking for related TODOs:" rg --type scala 'TODO.*logout' # Verify that the RegisteredUser case class is used correctly echo "Verifying RegisteredUser usage:" rg --type scala 'case class RegisteredUser'Length of output: 4115
bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (3)
181-181: LGTM:logoutUrlproperty added toMeetingEndedPropsThe addition of the
logoutUrlproperty to theMeetingEndedPropsinterface is correct and aligns with the PR objective of introducing a custom logout URL for each user.
194-194: LGTM:logoutUrladded toMeetingEndedcomponent propsThe
logoutUrlprop is correctly added to the destructured props of theMeetingEndedcomponent, ensuring it can be accessed within the component.
Line range hint
1-516: Summary oflogoutUrlimplementationThe implementation of the custom logout URL feature is generally well-done and aligns with the PR objectives. Key points:
- The
logoutUrlproperty is correctly added to relevant interfaces and components.- The feature allows for user-specific logout URLs as intended.
- Placeholder replacements in the URL enhance flexibility.
Areas for improvement:
- Implement URL validation before using
logoutUrlfor redirection to enhance security.- Add validation after placeholder replacements in the
confirmRedirectfunction.- Consider adding a comment explaining the source of
logoutUrlin theMeetingEndedContainerfor better code documentation.Overall, the changes effectively implement the desired functionality while maintaining code quality. Addressing the suggested improvements will further enhance the security and clarity of the implementation.
bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (1)
54-54: 🛠️ Refactor suggestionConsider addressing backward compatibility, validation, and documentation.
The addition of the
logoutUrlparameter to theRegisterUserReqMsgBodyconstructor correctly implements the per-user logout URL feature as requested. However, please consider the following points:
Backward Compatibility: Ensure that existing integrations that don't provide a
logoutUrlwon't be affected. Consider providing a default value or making it an optional parameter.Validation: Add validation for the
logoutUrlparameter to ensure it's a well-formed URL.Documentation: Update the relevant documentation to reflect this new parameter and its usage.
Consider refactoring the code to address these concerns:
- excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout, logoutUrl = msg.logoutUrl, userMetadata = msg.userMetadata) + excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout, logoutUrl = validateUrl(msg.logoutUrl), userMetadata = msg.userMetadata) + def validateUrl(url: Option[String]): Option[String] = { + url.filter(u => Try(new URL(u)).isSuccess) + }This refactoring adds a
validateUrlfunction to ensure thelogoutUrlis well-formed, and makes it an optional parameter.To ensure this change doesn't introduce unintended side effects, please run the following script:
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2)
291-291: LGTM! Consider adding URL validation for the logoutUrl parameter.The addition of the
logoutUrlparameter to theregisterUsermethod signature and its inclusion in theRegisterUserobject creation correctly implements the per-user logout URL functionality as per the PR objectives. However, to enhance security and robustness, consider adding URL validation for thelogoutUrlparameter.Here's a suggestion for implementing URL validation:
import java.net.URL def isValidUrl(url: String): Boolean = { try { new URL(url) true } catch { case _: Exception => false } } def registerUser(..., logoutUrl: String, ...): Unit = { require(logoutUrl.isEmpty || isValidUrl(logoutUrl), "Invalid logout URL provided") // ... rest of the method implementation }This validation will ensure that only valid URLs are accepted, improving the system's robustness.
To ensure that the
logoutUrlis being used correctly throughout the codebase, let's run a verification script:#!/bin/bash # Search for usages of logoutUrl in the codebase rg --type scala 'logoutUrl'This will help us identify any other places where
logoutUrlis used and ensure consistent handling across the application.Also applies to: 300-301
291-291: Review the logout process across the applicationThe addition of the
logoutUrlparameter to the user registration process is a significant change that could impact the logout flow across the application. To ensure a smooth integration of this new feature:
- Review all components handling user logout to ensure they use the new
logoutUrlparameter.- Update any relevant documentation to reflect this new functionality.
- If applicable, modify client-side code to handle the per-user logout URLs.
To help identify areas that might need updating, run the following script:
This will help locate areas of the codebase that deal with user logout, allowing for a comprehensive review and update of the logout process.
Also applies to: 300-301
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (3)
131-131: LGTM! Consistent with method signature change.The update to the
RegisterUserconstructor call correctly includes the newlogoutUrlparameter, ensuring consistency with the method signature change.
138-138: LGTM! VerifyRegisteredUserclass update.The update to the
RegisteredUserconstructor call correctly includes the newlogoutUrlparameter, maintaining consistency with the previous changes.Please ensure that the
RegisteredUserclass has been updated to include thelogoutUrlfield and handle it properly. Run the following command to verify:#!/bin/bash # Search for RegisteredUser class definition and verify logoutUrl field rg -p "class RegisteredUser" -A 20 | rg "String logoutUrl"
463-463: LGTM! Verifygw.registerUsermethod update.The update to the
processRegisterUsermethod call correctly includes the newlogoutUrlparameter, maintaining consistency with the previous changes.Please ensure that the
gw.registerUsermethod in the gateway class has been updated to handle the newlogoutUrlparameter. Run the following command to verify:bbb-graphql-server/bbb_schema.sql (1)
Line range hint
1-17: LGTM: Initial setup and utility functions look good.The initial setup includes creating the
unaccentextension and two utility functions:immutable_lower_unaccentandremove_emojis. These functions will be useful for text processing and sorting throughout the application.
…d code review comments
…d code review comments
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Outside diff range and nitpick comments (3)
bbb-common-message/src/main/scala/org/bigbluebutton/common2/util/UrlValidationUtil.scala (1)
5-14: Add ScalaDoc comments for better documentation.To improve code documentation and maintainability, consider adding ScalaDoc comments to the object and method.
Here's an example of how you could add ScalaDoc comments:
/** * Utility object for URL validation. */ object UrlValidationUtil { /** * Validates if the given string is a valid URL. * * @param url The string to be validated as a URL. * @return true if the string is a valid URL, false otherwise. */ def isValidUrl(url: String): Boolean = { // ... (existing implementation) } }akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (1)
9-9: LGTM! Consider enhancing test coverage for non-emptylogoutURLvalues.The addition of the
logoutURLparameter with a default empty string value is a good implementation of the new feature. It maintains backward compatibility while allowing for the new functionality.To improve test coverage, consider adding test cases that use non-empty
logoutURLvalues. This will ensure that the system correctly handles various logout URL scenarios.bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (1)
Line range hint
228-229: ValidatelogoutUrlbefore redirection to prevent open redirect vulnerabilitiesIn the
sendFeedbackfunction,window.location.hrefis set tologoutUrlwithout validation. This could expose the application to open redirect vulnerabilities iflogoutUrlcontains malicious content.Add validation before redirection:
setTimeout(() => { + if (validator.isURL(logoutUrl)) { window.location.href = logoutUrl; + } }, REDIRECT_WAIT_TIME);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1 hunks)
- akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (2 hunks)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/util/UrlValidationUtil.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (2 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala
🧰 Additional context used
🔇 Additional comments (6)
bbb-common-message/src/main/scala/org/bigbluebutton/common2/util/UrlValidationUtil.scala (1)
1-3: LGTM: Package declaration and imports are correct.The package declaration and import statement are properly structured and follow Scala conventions.
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (5)
15-15: LGTM: New import for URL validation.The addition of the
UrlvalidationUtilimport is appropriate for the new URL validation logic implemented in theregisterUsermethod.
292-292: LGTM: Updated method signature with logoutUrl parameter.The addition of the
logoutUrlparameter to theregisterUsermethod signature aligns with the PR objectives to allow per-user logout URLs. This change enables the implementation of custom logout behavior for each user.
298-300: LGTM: Robust URL validation implemented.The added URL validation logic ensures that the
logoutUrlis either empty or a valid URL. UsingrequirewithUrlvalidationUtil.isValidUrlis a good practice for enforcing preconditions. The error message is clear and informative.
304-305: LGTM: RegisterUser object updated with logoutUrl.The
RegisterUserobject creation has been correctly updated to include the newlogoutUrlparameter. This change is consistent with the method signature update and aligns with the PR objectives to implement per-user logout URLs.
15-15: Summary: Well-implemented per-user logout URL feature.The changes in this file successfully implement the per-user logout URL feature as outlined in the PR objectives. Key improvements include:
- Addition of the
UrlvalidationUtilimport for URL validation.- Updated
registerUsermethod signature with a newlogoutUrlparameter.- Robust URL validation logic to ensure valid logout URLs.
- Updated
RegisterUserobject creation to include the newlogoutUrlparameter.These changes are consistent, well-implemented, and follow good coding practices. The feature will allow for customized logout behavior for each user, enhancing the flexibility of the system.
Also applies to: 292-292, 298-300, 304-305
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-html5/package.json (1)
115-115: LGTM! Consider updating documentation.The addition of the
validatorpackage (version 13.12.0) is appropriate for the newlogoutURLparameter feature. This library will help ensure proper validation and sanitization of URLs.To maintain clear documentation:
- Consider adding a comment in the code where
validatoris used, explaining its purpose in relation to thelogoutURLfeature.- Update the project's documentation (e.g., README.md) to mention this new dependency and its role in the
logoutURLfeature.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
bigbluebutton-html5/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
- bigbluebutton-html5/package.json (1 hunks)
🧰 Additional context used
…d code review comments
…d code review comments
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1)
59-59: LGTM! Consider minor adjustment for consistency.The addition of the
logoutUrlgeneration is consistent with the existing code style and appropriate for creating fake test data.For improved consistency with other URL generations in this file, consider adding a random path to the URL:
- val logoutUrl = "https://www." + RandomStringGenerator.randomAlphanumericString(32) + ".com/"; + val logoutUrl = "https://www." + RandomStringGenerator.randomAlphanumericString(32) + ".com/" + + RandomStringGenerator.randomAlphanumericString(10) + ".html"This change would make the
logoutUrlstructure more similar toavatarURLandwebcamBackgroundURL.bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (1)
277-279: Good use of logoutUrl with validation, but consider error handlingThe implementation of
logoutUrlin theconfirmRedirectfunction, including the replacement of placeholders with user data and the use ofvalidator.isURLfor validation, is a good approach. This aligns with the PR objectives and adds a layer of security.However, consider adding error handling for cases where the URL is invalid. Currently, if
validator.isURLreturns false, the function silently fails to redirect. You might want to log this event or provide a fallback URL.Consider adding error handling:
if (validator.isURL(redirectTo)) { window.location.href = redirectTo; +} else { + console.error('Invalid logout URL:', redirectTo); + // Optionally, redirect to a default URL or show an error message }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1 hunks)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/util/UrlValidationUtil.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (2 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/util/UrlValidationUtil.scala
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala
🧰 Additional context used
🔇 Additional comments (6)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1)
62-62: LGTM! VerifyRegisteredUsers.createmethod signature.The addition of the
logoutUrlparameter to theRegisteredUsers.createmethod call is consistent with the PR objectives to allow per-user logout URLs.To ensure the change is correctly implemented, please verify the
RegisteredUsers.createmethod signature in the corresponding file. Run the following script to check the method signature:This will help confirm that the
logoutUrlparameter has been added to the method signature and that theMap()parameter has been correctly replaced or removed.bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (5)
8-8: Good addition of URL validatorThe import of the 'validator' library is a positive step towards ensuring the validity and security of custom logout URLs. This aligns well with the PR objectives and helps prevent potential security issues related to URL handling.
182-182: Appropriate interface update for logoutUrlThe addition of the
logoutUrlproperty to theMeetingEndedPropsinterface is consistent with the PR objectives. This change ensures type safety and proper integration of the new feature into the component's props.
195-195: Correct integration of logoutUrl propThe addition of
logoutUrlto the destructured props of theMeetingEndedcomponent ensures that the custom logout URL is properly accessible within the component. This change is in line with the PR objectives and enables the implementation of per-user logout URLs.
457-457: Correct integration of logoutUrl in MeetingEndedContainerThe addition of the
logoutUrlprop to theMeetingEndedcomponent calls withinMeetingEndedContaineris implemented correctly. The use of an empty string as a default value during loading or error states is appropriate. The retrieval oflogoutUrlfromuser_current[0]aligns well with the PR objectives of providing a per-user logout URL.These changes ensure that the custom logout URL is properly passed down from the container to the presentational component, maintaining the component hierarchy and data flow.
Also applies to: 475-475, 487-487, 515-515
Line range hint
1-520: Overall implementation of logoutUrl is well-executedThe changes introduced in this file effectively implement the per-user logout URL feature as outlined in the PR objectives. The
logoutUrlparameter is consistently integrated across the component hierarchy, from props to usage in the redirect logic. The addition of URL validation enhances security.While the implementation is generally solid, consider the suggested improvement for error handling in the
confirmRedirectfunction to make the code more robust.Great job on this feature implementation!
|
This pull request has conflicts ☹ |
|
I have resolved the conflicting changes |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Outside diff range and nitpick comments (8)
bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1)
26-26: Consider adding Javadoc to document parameter constraints.
The logoutUrl parameter would benefit from documentation specifying:
- Whether null/empty values are allowed
- Any URL format requirements or restrictions
- Example usage
Add Javadoc above the method:
/**
* Register a user for a meeting.
* @param logoutUrl The URL where the user will be redirected after logout.
* Can be null/empty to use the default logout URL.
* Must be a valid URL if provided.
*/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (1)
24-24: Add Javadoc to document the logoutUrl field.
Consider adding documentation to explain:
- The purpose of this field
- Expected format/constraints
- Relationship with user roles (moderator vs viewer URLs)
Add documentation like this:
+/**
+ * Custom URL where the user will be redirected after logout.
+ * Different URLs can be set based on user roles (e.g., moderator vs viewer).
+ */
public final String logoutUrl;bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1)
21-21: Consider adding URL validation for the logoutUrl parameter.
The addition of logoutUrl parameter aligns with the PR objectives. However, since this is a URL parameter, consider adding validation to ensure it's a valid URL format and follows any security requirements (e.g., HTTPS only, allowed domains).
You could add URL validation in the handleRegisterUser method:
import java.net.URL
import scala.util.Try
def handleRegisterUser(msg: RegisterUser): Unit = {
// Validate logout URL if present
if (msg.logoutUrl.nonEmpty) {
Try(new URL(msg.logoutUrl)).getOrElse {
log.warning(s"Invalid logout URL format: ${msg.logoutUrl}")
// Consider how to handle invalid URLs - throw exception or use default?
}
}
sendRegisterUserRequestToAkkaApps(msg)
}bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java (1)
77-79: Consider adding JavaDoc documentation.
The interface methods would benefit from JavaDoc documentation describing the parameters, especially the new logoutUrl parameter. This would help implementers understand the expected format and usage.
Example addition:
/**
* Registers a user in a meeting.
*
* @param meetingID The unique identifier of the meeting
* ...
* @param enforceLayout The layout to enforce for the user
* @param logoutUrl Custom URL where the user will be redirected after logout
* @param userMetadata Additional metadata for the user
*/
void registerUser(String meetingID, ...);akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (1)
10-11: LGTM! Consider documenting nullability requirements.
The logoutUrl parameter has been correctly added to the method signature and constructor call. However, it would be helpful to document whether this parameter can be null/empty and how such cases should be handled.
Also applies to: 36-38
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (1)
302-303: LGTM! URL validation implemented correctly.
The implementation properly validates the logout URL while maintaining backward compatibility by allowing empty URLs.
Consider adding unit tests to verify the URL validation behavior, especially edge cases like:
- Empty URLs
- Valid URLs with different schemes (http, https)
- Invalid URLs
- Malformed URLs
Would you like me to help create these tests?
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (1)
589-589: Consider adding URL validation for logoutUrl parameter.
While the logoutUrl parameter is correctly propagated to the gateway, it would be beneficial to validate the URL format before processing to ensure it's a well-formed URL.
Consider adding URL validation before processing:
private void processRegisterUser(RegisterUser message) {
+ if (message.logoutUrl != null && !message.logoutUrl.isEmpty()) {
+ try {
+ new URL(message.logoutUrl);
+ } catch (MalformedURLException e) {
+ log.warn("Invalid logoutUrl format: {}", message.logoutUrl);
+ }
+ }
gw.registerUser(message.meetingID,
message.internalUserId, message.fullname, message.role,
message.externUserID, message.authToken, message.sessionToken, message.avatarURL, message.webcamBackgroundURL, message.bot,
message.guest, message.authed, message.guestStatus, message.excludeFromDashboard, message.enforceLayout, message.logoutUrl, message.userMetadata);
}bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (1)
419-424: Enhance error handling and logging.
Consider improving error handling and logging:
- Add specific error cases for invalid URLs
- Include security-related logging
- Consider adding metrics for URL validation failures
String logoutUrl = meeting.getLogoutUrl()
if(!StringUtils.isEmpty(params.get(ApiParams.LOGOUT_URL))) {
+ try {
logoutUrl = params.get(ApiParams.LOGOUT_URL)
+ log.info("Custom logout URL set for user {} in meeting {}",
+ params.get("userID"), params.get("meetingID"))
+ } catch (Exception e) {
+ log.error("Failed to set custom logout URL: {}", e.getMessage())
+ // Use default URL from meeting
+ }
}
-log.debug "The following logout URL is present: " + logoutUrl
+log.info("Logout URL for user {} set to: {}",
+ params.get("userID"), logoutUrl)📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
bigbluebutton-html5/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (19)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala (1 hunks)
- akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (2 hunks)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (2 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1 hunks)
- bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (2 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1 hunks)
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1 hunks)
- bbb-graphql-server/bbb_schema.sql (2 hunks)
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (8 hunks)
- bigbluebutton-html5/package.json (1 hunks)
- bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (3 hunks)
🧰 Additional context used
📓 Learnings (1)
bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1)
Learnt from: jaapjansma
PR: bigbluebutton/bigbluebutton#21204
File: bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala:21-21
Timestamp: 2024-10-10T12:15:03.265Z
Learning: When reviewing code changes in BigBlueButton, particularly in case classes like `RegisterUser` in `MeetingsManagerActor.scala`, ensure to accurately distinguish between added parameters and replaced parameters to avoid incorrect assessments.
🔇 Additional comments (33)
bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java (1)
26-26: LGTM! The parameter addition aligns with the feature requirements.
The addition of the logoutUrl parameter to the registerUser method signature correctly implements the per-user logout URL feature requested in issue #20285.
bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/RegisterUser.java (2)
24-24: LGTM! The logoutUrl integration follows the existing patterns.
The changes maintain consistency with the existing codebase structure and naming conventions.
Also applies to: 30-30, 47-47
24-24: Consider adding input validation for the logoutUrl.
While this class serves as a message container, consider implementing URL validation at the service layer to ensure:
- The URL is well-formed
- The URL follows security policies (e.g., allowed domains)
- Protection against XSS or open redirect vulnerabilities
Let's check if URL validation exists in the codebase:
bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/ToAkkaAppsSendersTrait.scala (1)
33-33: LGTM! Verify URL validation.
The addition of logoutUrl to the message body is implemented correctly and follows the existing parameter passing pattern.
Let's verify the URL validation logic mentioned in the summary:
✅ Verification successful
URL validation is properly implemented
The logoutUrl parameter is validated in two places:
- In
BbbWebApiGWApp.scalausingUrlValidationUtil.isValidUrl()before registering the user - In
MsgBuilder.scalausing the same validation before including it in the message body
The validation ensures:
- URL is not null or empty
- URL has valid protocol (http/https)
- URL has valid format
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify URL validation implementation in MsgBuilder
# Expected: Find URL validation logic for logoutUrl parameter
# Search for URL validation in MsgBuilder
rg -A 5 "logoutUrl.*validation"
# Alternatively, look for the MsgBuilder class implementation
ast-grep --pattern 'class MsgBuilder {
$$$
validate($$$logoutUrl$$$) {
$$$
}
$$$
}'
Length of output: 131
Script:
#!/bin/bash
# Let's try a broader search for URL validation patterns and logoutUrl handling
# Search for files containing logoutUrl
rg -l "logoutUrl"
# Search for URL validation patterns
rg -A 5 "validateURL|isValidUrl|urlValidator"
# Search for MsgBuilder class with broader context
fd "MsgBuilder.scala" --exec cat {}
Length of output: 59640
bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala (1)
21-21: Verify handling of null/empty logoutUrl values.
Since this parameter affects the logout flow, it's important to ensure proper handling of cases where logoutUrl is null or empty.
✅ Verification successful
Proper null/empty logoutUrl handling is verified
The codebase shows proper handling of logoutUrl:
- Input validation through
require(logoutUrl.isEmpty || UrlValidationUtil.isValidUrl(logoutUrl)) - Null/empty checks with fallback to empty string:
if (msg.logoutUrl != null && !msg.logoutUrl.isEmpty && UrlValidationUtil.isValidUrl(msg.logoutUrl)) - Database layer handles empty values by converting empty strings to None:
case "" => None
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check how null/empty logoutUrl values are handled
# Search for null checks or default value assignments for logoutUrl
echo "Searching for logoutUrl null/empty handling:"
rg --type scala "logoutUrl\s*(==|!=|\.isEmpty|\.nonEmpty|\.getOrElse|match)"
# Search for default logout URL configuration
echo "\nSearching for default logout URL configuration:"
rg --type-add 'config:*.{conf,properties,xml}' --type config "logout.*url"
Length of output: 859
Script:
#!/bin/bash
# Let's check the implementation details around logoutUrl validation and handling
# Check the UrlValidationUtil implementation
echo "Checking UrlValidationUtil implementation:"
rg -A 5 "class UrlValidationUtil"
# Check how logoutUrl is used in MsgBuilder
echo "\nChecking logoutUrl usage in MsgBuilder:"
rg -A 10 "logoutUrl" "bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala"
# Check MeetingDAO implementation for logoutUrl handling
echo "\nChecking MeetingDAO logoutUrl handling:"
rg -A 5 "logoutUrl = meetingProps" "akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingDAO.scala"
Length of output: 2366
akka-bbb-apps/src/test/scala/org/bigbluebutton/core2/testdata/TestDataGen.scala (3)
9-9: LGTM: Method signature change is well-implemented.
The addition of the logoutURL parameter with a default empty string value maintains backward compatibility while supporting the new per-user logout URL feature.
22-22: Parameter casing inconsistency was previously identified.
The inconsistency between logoutURL (parameter) and logoutUrl (usage) remains to be addressed.
Line range hint 9-22: Test coverage enhancement was previously suggested.
The implementation would benefit from additional test cases using non-empty logout URLs, as mentioned in previous reviews.
bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java (1)
78-78: LGTM! The signature change aligns with requirements.
The addition of the logoutUrl parameter to registerUser correctly implements the per-user logout URL feature requested in issue #20285. The parameter placement is logical, maintaining consistency with other URL-related parameters.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala (2)
37-37:
Implementation appears incomplete for the logoutURL feature.
The RegisteredUsers.create call has been modified to accommodate new parameters, but the logoutUrl parameter isn't being passed. This could lead to compilation errors or incorrect behavior.
Let's verify the RegisteredUsers.create signature and its usages:
36-38: Consider role-based logout URL handling.
According to the PR objectives, this feature is needed to provide different logout URLs for moderators vs viewers. However, this implementation always sets the role to Roles.VIEWER_ROLE which may not fulfill the requirement.
Let's verify if there are other places handling moderator registration:
bigbluebutton-html5/package.json (1)
116-116: LGTM! Good choice for URL validation.
The addition of the validator package is appropriate for implementing secure URL validation for the custom logout URLs feature. This is a well-maintained package that will help prevent open redirect vulnerabilities.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala (1)
63-63: LGTM! Verify integration with RegisteredUsers.
The addition of logoutUrl parameter to RegisteredUsers.create correctly implements the per-user logout URL functionality as specified in the PR objectives.
Let's verify the integration with the RegisteredUsers class:
✅ Verification successful
Integration with RegisteredUsers is properly implemented
The verification confirms that:
- The
RegisteredUsercase class inRegisteredUsers.scalahas thelogoutUrlfield properly defined - The
RegisteredUsers.createmethod accepts thelogoutUrlparameter and correctly passes it to theRegisteredUserconstructor - The implementation aligns with the PR's objective of adding per-user logout URL functionality
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that RegisteredUsers class properly handles the logoutUrl parameter
# Test: Search for RegisteredUsers class definition and create method
ast-grep --pattern $'case class RegisteredUser(
$$$
logoutUrl: $_
$$$
)'
# Test: Verify that RegisteredUsers.create method accepts logoutUrl parameter
ast-grep --pattern $'def create(
$$$
logoutUrl: $_
$$$
): RegisteredUser'
Length of output: 160
Script:
#!/bin/bash
# Let's try a different approach using ripgrep to find the RegisteredUser class and its usage
rg -A 20 "case class RegisteredUser"
# Also search for RegisteredUsers object/class definition
rg -A 20 "object RegisteredUsers|class RegisteredUsers"
Length of output: 13033
Script:
#!/bin/bash
# Let's search for the logoutUrl field in RegisteredUser case class
rg -A 30 "case class RegisteredUser\(" akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala
Length of output: 1211
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/UserDAO.scala (3)
27-27: LGTM! Good choice of default value.
The addition of logoutUrl with a default empty string maintains backward compatibility while supporting the new feature.
35-35: Consider adding database constraints for the logoutUrl field.
While the table definition is correct, consider:
- Adding a maximum length constraint to prevent extremely long URLs
- Ensuring a database migration script exists for adding this column to existing tables
Let's check for migration scripts:
Also applies to: 57-57
88-89: Verify URL validation implementation.
The insert method accepts the logoutUrl without validation. While the PR mentions URL validation in BbbWebApiGWApp.scala, let's verify its implementation:
✅ Verification successful
Let me gather more information about the URL validation implementation.
URL validation is properly implemented
The logoutUrl is validated at multiple layers:
- In
BbbWebApiGWApp.scala, there's a validation check usingrequire(logoutUrl.isEmpty || UrlValidationUtil.isValidUrl(logoutUrl)) - The
UrlValidationUtil.isValidUrl()implementation ensures:- URL is not null
- URL is properly formatted (via
URLclass parsing) - Protocol is either HTTP or HTTPS
The validation occurs before the URL reaches the DAO layer, making it safe to store without additional validation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Look for URL validation implementation
rg -A 5 "logoutUrl.*valid"
ast-grep --pattern 'def $_(logoutUrl: String) {
$$$
}'
Length of output: 1069
Script:
#!/bin/bash
# Look for UrlValidationUtil implementation
rg -A 10 "class UrlValidationUtil"
rg -A 10 "object UrlValidationUtil"
# Look for other URL validation related code
rg -A 5 "isValidUrl"
Length of output: 3911
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala (1)
Line range hint 109-117: Verify database schema updates and migration strategy.
The changes to RegisteredUser affect database operations through UserDAO. Please ensure that:
- The database schema has been updated to accommodate the new
logoutUrlfield - A migration strategy exists for existing users
- The documentation in PR #21205 covers these database changes
✅ Verification successful
Based on the search results, I can generate the final response as we have sufficient information about the database schema and implementation.
Database schema and implementation are properly handled.
The changes to RegisteredUser with the logoutUrl field are properly accommodated:
- Database schema is updated in
bbb-graphql-server/bbb_schema.sqlwithlogoutUrl varchar(500) - Field is properly integrated in
UserDAO.scalawith corresponding column definition and mapping - Default empty string value is provided in
UserDAO.insertfor backward compatibility - URL validation is implemented in
BbbWebApiGWApp.scalabefore persistence
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for database schema updates and migrations
rg -g '*.sql' -g '*.scala' 'logoutUrl'
Length of output: 4973
bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx (3)
8-8: LGTM: Import and interface changes are well-structured
The validator import and interface updates are correctly implemented to support the per-user logout URL feature.
Also applies to: 182-182
195-195: LGTM: Proper prop handling for logoutUrl
The logoutUrl prop is correctly destructured and consistently used throughout the component.
457-457: LGTM: Verify logoutUrl data flow
The logoutUrl initialization and data flow are properly implemented with appropriate fallbacks for loading and error states.
Let's verify the logoutUrl data flow in the GraphQL schema and resolvers:
Also applies to: 475-475, 487-487, 515-515
✅ Verification successful
Let me try another search strategy to verify the logoutUrl data flow.
Based on the search results, I can now verify the logoutUrl data flow. The code shows:
- The logoutUrl is properly defined in the GraphQL schema (queries.ts)
- It's correctly passed through the user_current data in getMeetingEndData query
- The component handles loading/error states with empty string fallback
- The logoutUrl is used in multiple components and services with proper type definitions
- The backend systems (bbb-web, akka-apps) properly handle and validate the logoutUrl
Verified: logoutUrl data flow is implemented correctly
The initialization with empty string for loading/error states is a proper fallback pattern, and the actual logoutUrl value is correctly passed from the GraphQL query when data is available. The implementation follows the expected data flow pattern throughout the application.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check GraphQL schema and resolver implementations for logoutUrl
rg -A 5 'type.*User.*{' | rg -A 10 'logoutUrl'
rg -A 5 'getMeetingEndData'
Length of output: 2322
Script:
#!/bin/bash
# Search for logoutUrl in GraphQL schema files
fd schema.ts --exec rg -A 5 'type.*User' {} \;
# Search for logoutUrl in resolver implementations
rg -A 5 'logoutUrl'
# Search for any other relevant files that might handle logoutUrl
fd -e ts -e js --exec rg -l 'logoutUrl' {} \;
Length of output: 71595
bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala (3)
9-9: LGTM! Import added for URL validation.
The addition of UrlValidationUtil import is appropriate for the new URL validation functionality.
63-63: LGTM! Logout URL parameter added correctly.
The logoutUrl parameter is correctly added to the RegisterUserReqMsgBody constructor, maintaining consistency with the existing parameter pattern.
49-63: Verify consistent URL validation across the codebase.
Let's ensure that URL validation is consistently applied across the codebase for similar scenarios.
✅ Verification successful
URL validation is consistently implemented for logout URLs
The verification shows that URL validation is properly implemented in two key locations:
BbbWebApiGWApp.scala: Validates logout URL at the API gateway level usingrequireMsgBuilder.scala: Validates logout URL before message construction
The RegisterUserReqMsgBody construction is consistent across both implementations in:
MsgBuilder.scala: Uses validatedlogoutUrlToAkkaAppsSendersTrait.scala: Usesmsg.logoutUrlwhich is pre-validated byBbbWebApiGWApp
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for other URL validation usage patterns
echo "Checking URL validation patterns:"
rg "UrlValidationUtil.isValidUrl" -A 2
# Check for other instances of RegisterUserReqMsgBody construction
echo "Checking RegisterUserReqMsgBody usage:"
ast-grep --pattern 'RegisterUserReqMsgBody($$$)'
Length of output: 3065
bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala (1)
296-296: LGTM! Parameter handling implemented correctly.
The logoutUrl parameter is consistently handled in both the method signature and the RegisterUser constructor call.
Also applies to: 309-309
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1)
12-12: LGTM! Addition of logoutUrl parameter aligns with requirements.
The addition of the logoutUrl parameter to RegisterUserReqMsgBody implements the per-user logout URL feature as specified in issue #20285.
Let's verify the impact on existing code:
✅ Verification successful
All RegisterUserReqMsgBody instantiations have been properly updated with the logoutUrl parameter
The code search reveals that all instances where RegisterUserReqMsgBody is constructed already include the logoutUrl parameter in the correct position:
- In
MsgBuilder.scala:logoutUrl = logoutUrl - In
ToAkkaAppsSendersTrait.scala:logoutUrl = msg.logoutUrl
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for RegisterUserReqMsgBody instantiations that need to be updated
ast-grep --pattern 'RegisterUserReqMsgBody($$$)'
Length of output: 2077
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (3)
139-139: LGTM: Method signature updated to support per-user logout URL.
The logoutUrl parameter has been added to the registerUser method signature in an appropriate position.
143-144: LGTM: Proper propagation of logoutUrl to RegisterUser message.
The logoutUrl parameter is correctly passed to the RegisterUser message constructor.
150-150: LGTM: Proper propagation of logoutUrl to RegisteredUser constructor.
The logoutUrl parameter is correctly passed to the RegisteredUser constructor.
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (2)
419-424: LGTM! Proper handling of logout URL override.
The implementation correctly:
- Gets the default logout URL from the meeting
- Allows override via request parameter
- Includes debug logging
453-453: LGTM! Clean integration with existing flow.
The changes properly integrate the logout URL handling into the existing join and registration flow without disrupting current functionality.
Also applies to: 518-518
bbb-graphql-server/bbb_schema.sql (3)
286-286: LGTM: Appropriate column definition for logoutUrl.
The logoutUrl column is correctly defined with:
- Appropriate type (varchar) and length (500) for storing URLs
- Nullable constraint allowing optional custom logout URLs
- Logical placement with other user-specific URL fields
477-477: LGTM: Appropriate exposure of logoutUrl in user view.
The logoutUrl is correctly exposed in the v_user_current view, which is the appropriate view for current user information. This aligns with the PR objective of supporting per-user logout URLs.
286-286: Consider adding URL validation for security.
To prevent security issues like open redirects, consider:
- Adding a CHECK constraint or trigger to validate the URL format
- Implementing URL validation in the application layer
- Ensuring URLs are properly sanitized before storage
Also applies to: 477-477
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (1)
428-428: Fix indentation.The closing brace has incorrect indentation.
- } + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala(3 hunks)akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala(1 hunks)bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala(2 hunks)bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/testdata/FakeUserGenerator.scala
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala
🔇 Additional comments (3)
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (3)
40-40: LGTM: Import added for URL validation.
The import of UrlValidationUtil is appropriately placed and will be used for validating the logout URL.
420-431: LGTM: Per-user logout URL implementation.
The implementation correctly:
- Uses meeting's logout URL as default
- Validates user-provided URL
- Falls back to default URL if validation fails
- Logs the final URL used
525-525: LGTM: Added logout URL to user registration.
The logout URL is correctly passed to the user registration method.
|
I sent a PR with a fix to the failing automated-tests step, can you take a look @jaapjansma ? |
Small fixes for end meeting
|
@gustavotrott thanks! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
docs/docs/data/join.tsx (2)
70-75: Consider consistent parameter naming.The parameter structure and description are well-documented. However, for consistency with the existing
errorRedirectUrlparameter, consider usinglogoutUrlinstead oflogoutURL.- "name": "logoutURL", + "name": "logoutUrl",
74-74: Enhance documentation with role-specific examples.Given that a key use case is providing different logout URLs for moderators and viewers (as mentioned in the PR description), consider enhancing the description with examples:
- "description": (<>A custom URL to redirect client when the user click on OK button in the meeting ended screen. By default users are redirected to the meeting's default logout URL.</>) + "description": (<>A custom URL to redirect client when the user click on OK button in the meeting ended screen. This enables role-specific redirection - for example, moderators can be directed to a feedback form while viewers are sent to a thank you page. By default users are redirected to the meeting's default logout URL.</>)bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (2)
459-459: Add documentation for the logoutUrl fieldThe logoutUrl field's purpose and usage should be documented for better code maintainability.
Consider adding a comment explaining the field's purpose:
+ // Custom logout URL for this user session, falls back to meeting's logout URL if not specified us.logoutUrl = logoutUrl
524-524: Consider refactoring the registerUser method to use a builder patternThe registerUser method has 17 parameters, which makes it hard to maintain and prone to errors. The addition of logoutUrl further increases this complexity.
Consider creating a UserRegistrationParams class to encapsulate these parameters:
class UserRegistrationParams { String meetingID String internalUserId String fullname String role String externUserID String authToken String sessionToken String avatarURL String webcamBackgroundURL Boolean bot Boolean guest Boolean authed String guestStatus Boolean excludeFromDashboard Boolean leftGuestLobby String enforceLayout String logoutUrl Map<String, String> userCustomData static class Builder { // ... builder methods } }Then refactor the method call to:
def params = new UserRegistrationParams.Builder() .meetingID(us.meetingID) .internalUserId(us.internalUserId) // ... set other parameters .logoutUrl(us.logoutUrl) .userCustomData(meeting.getUserCustomData(us.externUserID)) .build() meetingService.registerUser(params)bbb-graphql-server/bbb_schema.sql (1)
286-286: LGTM! Consider URL validation at the application level.The
logoutUrlcolumn is well-defined with an appropriate data type and placement. While the schema definition is correct, ensure that URL validation is implemented at the application level to maintain data integrity.Consider implementing URL validation in the application layer to ensure:
- Valid URL format
- Allowed protocols (e.g., https)
- Maximum length within 500 characters
- Protection against malicious URLs
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
bigbluebutton-html5/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java(2 hunks)bbb-graphql-server/bbb_schema.sql(2 hunks)bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml(2 hunks)bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx(8 hunks)bigbluebutton-html5/package.json(2 hunks)bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy(3 hunks)docs/docs/data/join.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java
- bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx
- bigbluebutton-html5/package.json
🔇 Additional comments (6)
bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_user_current.yaml (3)
167-167: LGTM: Permission correctly added for bbb_client role
The logoutUrl column is properly added to the select permissions with appropriate row-level security filters in place.
214-214: LGTM: Permission correctly added for bbb_client_not_in_meeting role
The logoutUrl column is appropriately added to the limited set of permissions for users not in meetings, maintaining proper access control.
167-167: Consider implementing URL validation and security measures
While the permissions are correctly configured, consider implementing these additional security measures:
- URL validation to prevent malicious URLs
- URL allowlist/blocklist mechanism
- Logging of URL changes for security auditing
- Rate limiting for URL updates
This will help ensure the safety of the logout redirection process.
Let's check if URL validation is implemented elsewhere:
Also applies to: 214-214
✅ Verification successful
URL validation is implemented but could be strengthened
The codebase already implements basic URL validation through ValidationService.isValidURL(), which is used for logout URLs as evidenced in BbbWebApiGWApp.scala. However, the current implementation only checks for URL syntax validity using Java's URL/URI parsing.
To enhance security, consider strengthening the validation by:
- Adding URL scheme restrictions (e.g., only https://)
- Implementing domain allowlisting
- Adding protection against SSRF attacks
- Including validation for URL length and character set
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for URL validation patterns in the codebase
rg -i "validateurl|urlvalidation|isvalidurl"
# Search for security-related configurations
fd -t f "security|config" -x rg -l "url.*(valid|allow|block|whitelist|blacklist)"
Length of output: 922
Script:
#!/bin/bash
# Let's examine the URL validation implementation
ast-grep --pattern 'isValidURL($$$)'
# Check for any URL security patterns in the validation service
rg -A 10 "isValidURL" bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java
Length of output: 1020
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy (1)
419-429: 🛠️ Refactor suggestion
Enhance URL validation and error handling for logout URLs
The current implementation has several areas that could be improved:
- URL validation should happen before any assignment
- Error handling should be more robust than just logging
- URL sanitization is missing
- Logging is inconsistent (debug vs warn)
Consider this safer implementation:
String logoutUrl = meeting.getLogoutUrl()
if(!StringUtils.isEmpty(params.get(ApiParams.LOGOUT_URL))) {
String userProvidedUrl = StringUtils.strip(params.get(ApiParams.LOGOUT_URL))
ValidationService validationService = ServiceUtils.getValidationService()
if(!validationService.isValidURL(userProvidedUrl)) {
log.warn("Invalid logout URL provided [meetingId={}]: {}", meeting.getInternalId(), userProvidedUrl)
// Keep default URL from meeting
} else {
logoutUrl = userProvidedUrl
log.info("Custom logout URL set for meeting [{}]: {}", meeting.getInternalId(), logoutUrl)
}
}Likely invalid or redundant comment.
bbb-graphql-server/bbb_schema.sql (2)
477-477: LGTM! The view modification is correct.
The logoutUrl column is properly exposed through the v_user_current view, maintaining consistency with the base table and following the existing pattern for user attributes.
286-286: Verify schema compatibility and constraints.
Let's verify that the schema changes are complete and won't cause issues with existing functionality.
Also applies to: 477-477
✅ Verification successful
Schema changes for logoutUrl are consistent and safe
The verification shows:
- The
logoutUrlcolumn usesvarchar(500)which is consistent with other URL columns in the schema - No foreign key constraints or indexes are impacted by this change
- The URL validation is handled at the application level through
ValidationService.isValidURL() - No schema-level constraints or triggers are affected
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify schema compatibility and look for potential issues
# Check for any foreign key constraints or indexes referencing the user table
echo "Checking for dependencies on the user table..."
rg -A 5 'REFERENCES "user"'
# Look for any URL-related columns to ensure consistent data types
echo "Checking URL column definitions for consistency..."
rg 'url.*varchar' -i
# Check for any potential validation or trigger functions that might need updating
echo "Checking for URL validation functions..."
rg 'isValidURL|validateURL|checkURL' -i
Length of output: 16556
| String logoutUrl = meeting.getLogoutUrl() | ||
| if(!StringUtils.isEmpty(params.get(ApiParams.LOGOUT_URL))) { | ||
| String userProvidedUrl = params.get(ApiParams.LOGOUT_URL) | ||
| if(!ServiceUtils.getValidationService().isValidURL(userProvidedUrl)) { | ||
| log.warn("Invalid logout URL provided: " + userProvidedUrl) | ||
| // Use default URL from meeting | ||
| } else { | ||
| logoutUrl = params.get(ApiParams.LOGOUT_URL) | ||
| log.debug "The following logout URL is present: " + logoutUrl | ||
| } | ||
| } |
There was a problem hiding this comment.
💡 Codebase verification
Security improvements needed for URL validation
The URL validation implementation in ValidationService.java only performs basic syntax validation using URL and URI classes, which is insufficient for security. Current implementation lacks:
- Protocol restrictions (allows any protocol including javascript:, data:)
- Domain allowlisting
- Protection against open redirects
- XSS prevention
Recommended changes:
- Add protocol whitelist (http/https only)
- Implement domain allowlisting
- Add checks for common attack patterns in URLs
- Consider using a security library like OWASP's URL Validator
Location:
bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java
🔗 Analysis chain
Verify URL validation implementation for security
The current URL validation needs to be verified to ensure it properly protects against:
- Open redirect vulnerabilities
- Protocol restrictions (e.g., only http/https)
- Domain allowlisting
- XSS through javascript: URLs
Let's verify the URL validation implementation:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check URL validation implementation
# Expected: Find URL validation method to verify security measures
# Search for URL validation implementation
rg -A 10 "isValidURL|validateURL"
# Search for any URL-related security measures
ast-grep --pattern 'class ValidationService {
$$$
isValidURL($url) {
$$$
}
$$$
}'
Length of output: 7581
|
Automated tests Summary✅ All the CI tests have passed! |
|
The URL validation makes the placeholders like Maybe we can accept the PR as is, and refactor the code to handle this cases. |
|
If needed I am happy to create a follow up PR fixing this issue |
That would be great! |
It makes sense, the reason I didn't do the substitution on the back end is because by the point we generated the logoutUrl we did not have access to all the data we needed. Doing it on a per user basis should make it possible. |



What does this PR do?
This PR adds a logoutURL parameter to the joinMeeting api. This introduces a feature to have a per user logoutURL
Closes Issue(s)
Closes #20285
Motivation
We are using big blue button in our organization and we create a meeting from our CiviCRM installation. We want the moderator to go to a different url after logging out. In the url for the moderator we ask the moderator some follow up questions about the meeting and we store that result in our CiviCRM.
The viewers should go to the normal logout page.
More