Skip to content

Conversation

@sebclemens
Copy link
Contributor

This pull request adds support for protecting public recordings with a dedicated access code.

Here is my first request to this feature:
#6043

Feature Demo
Below is a short demonstration of the new functionality in action:

add-access-code-for-public-recordings

What this adds

  • Users can now share public recordings securely by assigning an access code.
  • Viewers must enter the access code to access the recording.

This improves security and flexibility for sharing content with external audiences.

@sebclemens sebclemens force-pushed the add-access-code-for-public-recordings branch from 5a1acba to d6dd1cc Compare May 16, 2025 00:23
@sebclemens sebclemens force-pushed the add-access-code-for-public-recordings branch from fafbe31 to 40c676d Compare May 16, 2025 01:09
@sonarqubecloud
Copy link

@marclaporte
Copy link
Contributor

Related: #6136

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

Comment on lines +61 to +68
if option.nil? && is_access_code
option = RoomMeetingOption.create!(
room_id: @room.id,
meeting_option_id: MeetingOption.find_by(name: name).id,
value: value
)
return render_data status: :ok
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Its better to do this in a data migration

Comment on lines +144 to +146
recordings_access_code = RoomMeetingOption.joins(:meeting_option)
.where(room_id: @room.id, meeting_options: { name: 'glRecordingsAccessCode' })
.first&.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to get the value using the RoomSettingsGetter (similar to this)

    viewer_code = RoomSettingsGetter.new(
      room_id: @room.id,
      provider: @room.user.provider,
      current_user: @current_user,
      show_codes: true,
      settings: 'glViewerAccessCode'
    ).call


# If a recordings access code exists and the provided code doesn't match, require access code
if recordings_access_code.present? && params[:access_code] != recordings_access_code
return render_data data: [], meta: { requires_access_code: true }, status: :ok
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather we return something like this instead
return render_error status: :forbidden

pagy, recordings = pagy(@room.public_recordings.order(sort_config, recorded_at: :desc).public_search(params[:search]))

render_data data: recordings, meta: pagy_metadata(pagy), serializer: PublicRecordingSerializer, status: :ok
render_data data: recordings, meta: pagy_metadata(pagy).merge(requires_access_code: false), serializer: PublicRecordingSerializer, status: :ok
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not quite sure what this is doing, but it shouldn't be doing it

{publicRoom?.data.name}
</h1>
{ (recordValue !== 'false') && recordings?.data?.length > 0 && (
{ (recordValue !== 'false') && (recordings?.data?.length > 0 || recordings?.meta?.requires_access_code === true) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh - I would look at how the viewer access code works and implement something similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants