Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Users without preview permission subscribing to public channel stream #34922

Merged
merged 21 commits into from
Jan 17, 2025

Conversation

tiagoevanp
Copy link
Contributor

@tiagoevanp tiagoevanp commented Jan 9, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

CORE-855

Copy link
Contributor

dionisio-bot bot commented Jan 9, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: 0dcf7e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 37 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/i18n Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/ui-voip Major
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 9, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34922/

Built to branch gh-pages at 2025-01-17 18:45 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.22%. Comparing base (baaee3f) to head (0dcf7e9).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #34922      +/-   ##
===========================================
+ Coverage    59.18%   59.22%   +0.03%     
===========================================
  Files         2819     2819              
  Lines        67719    67485     -234     
  Branches     15081    15013      -68     
===========================================
- Hits         40077    39965     -112     
+ Misses       24819    24711     -108     
+ Partials      2823     2809      -14     
Flag Coverage Δ
unit 75.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@gabriellsh gabriellsh left a comment

Choose a reason for hiding this comment

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

I think NotSubscribedState either doesn't need to be a separate component (could be directly rendered in the NotSubscribedRoom componenet) or at least it should be in the views/room folder. Even if we could use it somewhere else in the future, we can move it when we need.

A side note: This might seem like nit picking, but could you rename the components/error so that their names are in the same pattern of the other Errors/Room State components? It's not a big deal but it helps understand what each thing mean.

apps/meteor/client/views/room/RoomOpener.tsx Outdated Show resolved Hide resolved
apps/meteor/client/views/room/RoomOpenerEmbedded.tsx Outdated Show resolved Hide resolved
apps/meteor/client/views/room/hooks/useOpenRoom.ts Outdated Show resolved Hide resolved
apps/meteor/client/hooks/useJoinRoom.ts Outdated Show resolved Hide resolved
apps/meteor/client/hooks/useJoinRoom.ts Outdated Show resolved Hide resolved
@tiagoevanp tiagoevanp marked this pull request as ready for review January 16, 2025 18:41
@tiagoevanp tiagoevanp requested a review from a team as a code owner January 16, 2025 18:41
@tiagoevanp tiagoevanp requested a review from gabriellsh January 16, 2025 18:41
@tiagoevanp tiagoevanp modified the milestones: 7.2.0, 7.3.0 Jan 16, 2025
@tiagoevanp tiagoevanp force-pushed the fix/public-room-subscription-preview branch from 8fbfb13 to 9037159 Compare January 16, 2025 21:24
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Is it possible to add some tests to ensure this?

@MarcosSpessatto
Copy link
Member

Is it possible to add some tests to ensure this?

Aligned internally, we'll skip the tests temporarily

Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

According to the problem description, the server's stream allows users without permission to subscribe to the stream. I understand we are preventing at the client side, but I think we should also ensure the stream itself doesn't allow unauthorized users to subscribe to it. Will be address in another task

@tiagoevanp tiagoevanp force-pushed the fix/public-room-subscription-preview branch from 9037159 to 05434e5 Compare January 17, 2025 11:59
…ketChat/Rocket.Chat into fix/public-room-subscription-preview
@tiagoevanp tiagoevanp force-pushed the fix/public-room-subscription-preview branch from a681511 to 0744c83 Compare January 17, 2025 14:25
@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Jan 17, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 17, 2025
@kodiakhq kodiakhq bot merged commit 3c237b2 into develop Jan 17, 2025
54 checks passed
@kodiakhq kodiakhq bot deleted the fix/public-room-subscription-preview branch January 17, 2025 19:51
This was referenced Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants