Skip to content

Conversation

@yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Feb 26, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments


This pull request addresses an issue in the Rocket.Chat repository related to the flashing of the two-factor authentication (2FA) check for mandatory roles. The changes are made in the fix/2FA-mandatory-check-flashing branch and are intended to be merged into the develop branch.

The modifications include:

  1. apps/meteor/app/authentication/server/startup/index.js: The user fields projection is updated by replacing getBaseUserFields with getBaseUserFieldsWithTwoFactor. This change ensures that two-factor authentication fields are included in the default published fields for user accounts.

  2. apps/meteor/app/utils/server/functions/getBaseUserFields.ts: A new function, getBaseUserFieldsWithTwoFactor, is added. This function returns user fields that include 2FA settings, enhancing the handling of user data with respect to two-factor authentication.

  3. apps/meteor/server/startup/initialData.js: The code now includes logic to insert an admin user using environment variables. It also manages different scenarios such as the presence of existing admins, identifying the oldest user, and operating in test mode.

These changes aim to improve the handling of two-factor authentication for users with mandatory roles, ensuring a more stable and secure authentication process.

CORE-1000

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 26, 2025

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2025

🦋 Changeset detected

Latest commit: d06ded3

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

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@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/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts 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/mock-providers Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration 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

@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.67%. Comparing base (a12d7f2) to head (d06ded3).
Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #35340   +/-   ##
========================================
  Coverage    59.67%   59.67%           
========================================
  Files         2826     2826           
  Lines        68309    68309           
  Branches     15131    15131           
========================================
  Hits         40762    40762           
  Misses       24936    24936           
  Partials      2611     2611           
Flag Coverage Δ
unit 75.86% <ø> (ø)

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yash-rajpal
Copy link
Member Author

@kody start-review

@kody-ai
Copy link

kody-ai bot commented Feb 28, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization

Access your configuration settings here.

@yash-rajpal yash-rajpal marked this pull request as ready for review March 3, 2025 14:54
@yash-rajpal yash-rajpal requested review from a team as code owners March 3, 2025 14:54
@lucas-a-pelegrino lucas-a-pelegrino dismissed their stale review March 3, 2025 18:54

Dismissing while we discuss the use of getDefaultUserFields().

MarcosSpessatto
MarcosSpessatto previously approved these changes Mar 6, 2025
@MarcosSpessatto MarcosSpessatto added this to the 7.5.0 milestone Mar 7, 2025
@scuciatto scuciatto added the stat: QA assured Means it has been tested and approved by a company insider label Mar 12, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2025

PR Preview Action v1.6.0

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

Built to branch gh-pages at 2025-03-20 18:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

gabriellsh
gabriellsh previously approved these changes Mar 12, 2025
Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com>
gabriellsh
gabriellsh previously approved these changes Mar 20, 2025
ggazzo
ggazzo previously approved these changes Mar 20, 2025
@ggazzo ggazzo merged commit 715b62e into develop Mar 20, 2025
41 checks passed
@ggazzo ggazzo deleted the fix/2FA-mandatory-check-flashing branch March 20, 2025 20:17
ggazzo added a commit that referenced this pull request Mar 20, 2025
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
abhinavkrin pushed a commit that referenced this pull request Mar 24, 2025
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants