-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into fetc…
…hAvatarById * 'develop' of github.com:RocketChat/Rocket.Chat: fix: Infinite loading when uploading a private app (#33181) chore: publish preview github pages (#33248) chore: move playground (#33260) chore: E2EE setting warning update (#33224) fix: message parser being slow to process very long messages with too many symbols (#33227) chore: fix ui-playground build (#33250) feat: Option to disable 2FA for OAuth users (#32945) fix: Allow to use the token from `room.v` when requesting transcript instead of finding visitor (#33211)
- Loading branch information
Showing
249 changed files
with
810 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
Allow to use the token from `room.v` when requesting transcript instead of visitor token. Visitors may change their tokens at any time, rendering old conversations impossible to access for them (or for APIs depending on token) as the visitor token won't match the `room.v` token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@rocket.chat/message-parser': patch | ||
'@rocket.chat/peggy-loader': patch | ||
--- | ||
|
||
Improved the performance of the message parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@rocket.chat/i18n': minor | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
Added a new setting which allows workspace admins to disable email two factor authentication for SSO (OAuth) users. If enabled, SSO users won't be asked for email two factor authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
Fixed issue that caused an infinite loading state when uploading a private app to Rocket.Chat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# .github/workflows/ci-preview.yml | ||
name: Deploy PR previews | ||
concurrency: preview-${{ github.ref }} | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: rharkor/[email protected] | ||
if: github.event.action != 'closed' | ||
|
||
- name: Setup NodeJS | ||
uses: ./.github/actions/setup-node | ||
if: github.event.action != 'closed' | ||
with: | ||
node-version: 14.21.3 | ||
cache-modules: true | ||
install: true | ||
|
||
- name: Build | ||
if: github.event.action != 'closed' | ||
run: | | ||
yarn turbo run build-preview | ||
yarn turbo run .:build-preview-move | ||
- uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: .preview | ||
preview-branch: gh-pages | ||
umbrella-dir: pr-preview | ||
action: auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,8 @@ yarn-error.log* | |
.history | ||
.envrc | ||
|
||
.preview | ||
|
||
*.sublime-workspace | ||
|
||
**/.vim/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import proxyquire from 'proxyquire'; | ||
import sinon from 'sinon'; | ||
|
||
const settingsMock = sinon.stub(); | ||
|
||
const { EmailCheck } = proxyquire.noCallThru().load('./EmailCheck', { | ||
'@rocket.chat/models': { | ||
Users: {}, | ||
}, | ||
'meteor/accounts-base': { | ||
Accounts: { | ||
_bcryptRounds: () => '123', | ||
}, | ||
}, | ||
'../../../../server/lib/i18n': { | ||
i18n: { | ||
t: (key: string) => key, | ||
}, | ||
}, | ||
'../../../mailer/server/api': { | ||
send: () => undefined, | ||
}, | ||
'../../../settings/server': { | ||
settings: { | ||
get: settingsMock, | ||
}, | ||
}, | ||
}); | ||
|
||
const normalUserMock = { services: { email2fa: { enabled: true } }, emails: [{ email: '[email protected]', verified: true }] }; | ||
const normalUserWithUnverifiedEmailMock = { | ||
services: { email2fa: { enabled: true } }, | ||
emails: [{ email: '[email protected]', verified: false }], | ||
}; | ||
const OAuthUserMock = { services: { google: {} }, emails: [{ email: '[email protected]', verified: true }] }; | ||
|
||
describe('EmailCheck', () => { | ||
let emailCheck: typeof EmailCheck; | ||
beforeEach(() => { | ||
settingsMock.reset(); | ||
|
||
emailCheck = new EmailCheck(); | ||
}); | ||
|
||
it('should return EmailCheck is enabled for a normal user', () => { | ||
settingsMock.returns(true); | ||
|
||
const isEmail2FAEnabled = emailCheck.isEnabled(normalUserMock); | ||
|
||
expect(isEmail2FAEnabled).to.be.equal(true); | ||
}); | ||
|
||
it('should return EmailCheck is not enabled for a normal user with unverified email', () => { | ||
settingsMock.returns(true); | ||
|
||
const isEmail2FAEnabled = emailCheck.isEnabled(normalUserWithUnverifiedEmailMock); | ||
|
||
expect(isEmail2FAEnabled).to.be.equal(false); | ||
}); | ||
|
||
it('should return EmailCheck is not enabled for a OAuth user with setting being false', () => { | ||
settingsMock.returns(true); | ||
|
||
const isEmail2FAEnabled = emailCheck.isEnabled(OAuthUserMock); | ||
|
||
expect(isEmail2FAEnabled).to.be.equal(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
apps/meteor/app/utils/server/functions/getBaseUserFields.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
type UserFields = { | ||
[k: string]: number; | ||
}; | ||
|
||
export const getBaseUserFields = (): UserFields => ({ | ||
'name': 1, | ||
'username': 1, | ||
'nickname': 1, | ||
'emails': 1, | ||
'status': 1, | ||
'statusDefault': 1, | ||
'statusText': 1, | ||
'statusConnection': 1, | ||
'bio': 1, | ||
'avatarOrigin': 1, | ||
'utcOffset': 1, | ||
'language': 1, | ||
'settings': 1, | ||
'enableAutoAway': 1, | ||
'idleTimeLimit': 1, | ||
'roles': 1, | ||
'active': 1, | ||
'defaultRoom': 1, | ||
'customFields': 1, | ||
'requirePasswordChange': 1, | ||
'requirePasswordChangeReason': 1, | ||
'statusLivechat': 1, | ||
'banners': 1, | ||
'oauth.authorizedClients': 1, | ||
'_updatedAt': 1, | ||
'avatarETag': 1, | ||
'extension': 1, | ||
'openBusinessHours': 1, | ||
}); |
35 changes: 5 additions & 30 deletions
35
apps/meteor/app/utils/server/functions/getDefaultUserFields.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,14 @@ | ||
type DefaultUserFields = { | ||
import { getBaseUserFields } from './getBaseUserFields'; | ||
|
||
type UserFields = { | ||
[k: string]: number; | ||
}; | ||
|
||
export const getDefaultUserFields = (): DefaultUserFields => ({ | ||
'name': 1, | ||
'username': 1, | ||
'nickname': 1, | ||
'emails': 1, | ||
'status': 1, | ||
'statusDefault': 1, | ||
'statusText': 1, | ||
'statusConnection': 1, | ||
'bio': 1, | ||
'avatarOrigin': 1, | ||
'utcOffset': 1, | ||
'language': 1, | ||
'settings': 1, | ||
'enableAutoAway': 1, | ||
'idleTimeLimit': 1, | ||
'roles': 1, | ||
'active': 1, | ||
'defaultRoom': 1, | ||
'customFields': 1, | ||
'requirePasswordChange': 1, | ||
'requirePasswordChangeReason': 1, | ||
export const getDefaultUserFields = (): UserFields => ({ | ||
...getBaseUserFields(), | ||
'services.github': 1, | ||
'services.gitlab': 1, | ||
'services.password.bcrypt': 1, | ||
'services.totp.enabled': 1, | ||
'services.email2fa.enabled': 1, | ||
'statusLivechat': 1, | ||
'banners': 1, | ||
'oauth.authorizedClients': 1, | ||
'_updatedAt': 1, | ||
'avatarETag': 1, | ||
'extension': 1, | ||
'openBusinessHours': 1, | ||
}); |
Oops, something went wrong.