-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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' into chore/setup-wizard-step-four
- Loading branch information
Showing
272 changed files
with
5,278 additions
and
2,665 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": minor | ||
--- | ||
|
||
New setting to automatically enable autotranslate when joining rooms |
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 | ||
--- | ||
|
||
chore: Deprecate un-used meteor method for omnichannel analytics |
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,22 @@ | ||
--- | ||
'@rocket.chat/license': minor | ||
'@rocket.chat/jwt': minor | ||
'@rocket.chat/omnichannel-services': minor | ||
'@rocket.chat/omnichannel-transcript': minor | ||
'@rocket.chat/authorization-service': minor | ||
'@rocket.chat/stream-hub-service': minor | ||
'@rocket.chat/presence-service': minor | ||
'@rocket.chat/account-service': minor | ||
'@rocket.chat/core-services': minor | ||
'@rocket.chat/model-typings': minor | ||
'@rocket.chat/core-typings': minor | ||
'@rocket.chat/rest-typings': minor | ||
'@rocket.chat/ddp-streamer': minor | ||
'@rocket.chat/queue-worker': minor | ||
'@rocket.chat/presence': minor | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
Implemented the License library, it is used to handle the functionality like expiration date, modules, limits, etc. | ||
Also added a version v3 of the license, which contains an extended list of features. | ||
v2 is still supported, since we convert it to v3 on the fly. |
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,22 @@ | ||
name: Github vulnerabilities and jira board integration | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
IntegrateSecurityVulnerabilities: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Github vulnerabilities and jira board integration" | ||
uses: RocketChat/[email protected] | ||
env: | ||
JIRA_URL: https://rocketchat.atlassian.net/ | ||
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} | ||
JIRA_EMAIL: [email protected] | ||
JIRA_PROJECT_ID: GJIT | ||
UID_CUSTOMFIELD_ID: customfield_10059 | ||
JIRA_COMPLETE_PHASE_ID: 31 | ||
JIRA_START_PHASE_ID: 11 | ||
|
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,52 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import proxyquire from 'proxyquire'; | ||
import sinon from 'sinon'; | ||
|
||
const hasAllPermissionAsyncMock = sinon.stub(); | ||
const getCachedSupportedVersionsTokenMock = sinon.stub(); | ||
|
||
const { getServerInfo } = proxyquire.noCallThru().load('./getServerInfo', { | ||
'../../../utils/rocketchat.info': { | ||
Info: { | ||
version: '3.0.1', | ||
}, | ||
}, | ||
'../../../authorization/server/functions/hasPermission': { | ||
hasPermissionAsync: hasAllPermissionAsyncMock, | ||
}, | ||
'../../../cloud/server/functions/supportedVersionsToken/supportedVersionsToken': { | ||
getCachedSupportedVersionsToken: getCachedSupportedVersionsTokenMock, | ||
}, | ||
'../../../settings/server': { | ||
settings: new Map(), | ||
}, | ||
}); | ||
describe('#getServerInfo()', () => { | ||
beforeEach(() => { | ||
hasAllPermissionAsyncMock.reset(); | ||
getCachedSupportedVersionsTokenMock.reset(); | ||
}); | ||
|
||
it('should return only the version (without the patch info) when the user is not present', async () => { | ||
expect(await getServerInfo(undefined)).to.be.eql({ version: '3.0' }); | ||
}); | ||
|
||
it('should return only the version (without the patch info) when the user present but they dont have permission', async () => { | ||
hasAllPermissionAsyncMock.resolves(false); | ||
expect(await getServerInfo('userId')).to.be.eql({ version: '3.0' }); | ||
}); | ||
|
||
it('should return the info object + the supportedVersions from the cloud when the request to the cloud was a success', async () => { | ||
const signedJwt = 'signedJwt'; | ||
hasAllPermissionAsyncMock.resolves(true); | ||
getCachedSupportedVersionsTokenMock.resolves(signedJwt); | ||
expect(await getServerInfo('userId')).to.be.eql({ info: { version: '3.0.1', supportedVersions: signedJwt } }); | ||
}); | ||
|
||
it('should return the info object ONLY from the cloud when the request to the cloud was NOT a success', async () => { | ||
hasAllPermissionAsyncMock.resolves(true); | ||
getCachedSupportedVersionsTokenMock.rejects(); | ||
expect(await getServerInfo('userId')).to.be.eql({ info: { version: '3.0.1' } }); | ||
}); | ||
}); |
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,23 +1,37 @@ | ||
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; | ||
import { Info } from '../../../utils/rocketchat.info'; | ||
import { | ||
getCachedSupportedVersionsToken, | ||
wrapPromise, | ||
} from '../../../cloud/server/functions/supportedVersionsToken/supportedVersionsToken'; | ||
import { Info, minimumClientVersions } from '../../../utils/rocketchat.info'; | ||
|
||
type ServerInfo = | ||
| { | ||
info: typeof Info; | ||
} | ||
| { | ||
version: string | undefined; | ||
}; | ||
type ServerInfo = { | ||
info?: typeof Info; | ||
supportedVersions?: { signed: string }; | ||
minimumClientVersions: typeof minimumClientVersions; | ||
version: string; | ||
}; | ||
|
||
const removePatchInfo = (version: string): string => version.replace(/(\d+\.\d+).*/, '$1'); | ||
|
||
export async function getServerInfo(userId?: string): Promise<ServerInfo> { | ||
if (userId && (await hasPermissionAsync(userId, 'get-server-info'))) { | ||
return { | ||
info: Info, | ||
}; | ||
} | ||
const hasPermissionToViewStatistics = userId && (await hasPermissionAsync(userId, 'view-statistics')); | ||
const supportedVersionsToken = await wrapPromise(getCachedSupportedVersionsToken()); | ||
|
||
return { | ||
version: removePatchInfo(Info.version), | ||
|
||
...(hasPermissionToViewStatistics && { | ||
info: { | ||
...Info, | ||
}, | ||
version: Info.version, | ||
}), | ||
|
||
minimumClientVersions, | ||
...(supportedVersionsToken.success && | ||
supportedVersionsToken.result && { | ||
supportedVersions: { signed: supportedVersionsToken.result }, | ||
}), | ||
}; | ||
} |
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
Oops, something went wrong.