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

chore!: Improve permissions check on im endpoints #32333

Merged
merged 20 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5cea67f
chore: bump 7.0.0
ggazzo Apr 8, 2024
9b3d017
fix!: api login should not suggest which credential is wrong (#32159)
ggazzo Apr 9, 2024
8d5b603
chore!: remove hipchat importer (#32154)
pierre-lehnen-rc Apr 11, 2024
c2ab323
chore!: Removed Mongo 4.4. support and added 7.0 (#32162)
ggazzo Apr 12, 2024
68fee68
rebase with mongo
ggazzo Apr 24, 2024
42bde44
chore: Improve permissions check on im endpoints
matheusbsilva137 Apr 29, 2024
94b238d
chore: bump 7.0.0
ggazzo Apr 8, 2024
fcc9265
fix!: api login should not suggest which credential is wrong (#32159)
ggazzo Apr 9, 2024
cd0313b
chore!: remove hipchat importer (#32154)
pierre-lehnen-rc Apr 11, 2024
405da2a
chore!: Removed Mongo 4.4. support and added 7.0 (#32162)
ggazzo Apr 12, 2024
ce31b9d
rebase with mongo
ggazzo Apr 24, 2024
1c13d06
chore!: Improve permissions check on channels endpoints (#32330)
matheusbsilva137 May 3, 2024
8f45647
chore: Improve permissions check on cloud endpoints (#32331)
matheusbsilva137 May 3, 2024
ecaa003
chore: Improve permissions check on instances endpoints (#32334)
matheusbsilva137 May 3, 2024
5ee72d7
chore: Improve permissions check on LDAP endpoints (#32335)
matheusbsilva137 May 3, 2024
cb2fa7f
chore!: Improve permissions check on mailer endpoints (#32336)
matheusbsilva137 May 3, 2024
c42eef9
chore: Improve permissions check on users endpoints (#32353)
matheusbsilva137 May 7, 2024
5d45aed
Merge branch 'release-7.0.0' into chore/permissions-check-im
matheusbsilva137 May 7, 2024
9678f22
Merge branch 'release-7.0.0' into chore/permissions-check-im
matheusbsilva137 May 10, 2024
e696d53
test: add one more test case
matheusbsilva137 May 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/fair-seahorses-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@rocket.chat/meteor': major
---

As per MongoDB Lifecycle Schedules ([mongodb.com/legal/support-policy/lifecycles](https://www.mongodb.com/legal/support-policy/lifecycles)) we're removing official support to MongoDB version 4.4 that has reached end of life in February 2024.

We recommend upgrading to at least MongoDB 6.0+, though 5.0 is still a supported version.

Here are official docs on how to upgrade to some of the supported versions:

- [mongodb.com/docs/manual/release-notes/5.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-replica-set/)
- [mongodb.com/docs/manual/release-notes/6.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-replica-set/)
- [mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set/)
5 changes: 5 additions & 0 deletions .changeset/fluffy-knives-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---

Added MongoDB 7.0 support
7 changes: 7 additions & 0 deletions .changeset/fuzzy-cherries-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rocket.chat/meteor": major
---

Api login should not suggest which credential is wrong (password/username)

Failed login attemps will always return `Unauthorized` instead of the internal fail reason
5 changes: 5 additions & 0 deletions .changeset/quiet-kings-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': major
---

Removed the ability to import data in the HipChat Enterprise format, as it was discontinued over five years ago.
8 changes: 4 additions & 4 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
transporter:
type: string
mongodb-version:
default: "['4.4', '6.0']"
default: "['5.0', '7.0']"
required: false
type: string
release:
Expand Down Expand Up @@ -74,16 +74,16 @@ jobs:
test:
runs-on: ubuntu-20.04
env:
RC_DOCKERFILE: ${{ matrix.mongodb-version == '6.0' && inputs.rc-dockerfile-alpine || inputs.rc-dockerfile }}
RC_DOCKER_TAG: ${{ matrix.mongodb-version == '6.0' && inputs.rc-docker-tag-alpine || inputs.rc-docker-tag }}
RC_DOCKERFILE: ${{ matrix.mongodb-version == '7.0' && inputs.rc-dockerfile-alpine || inputs.rc-dockerfile }}
RC_DOCKER_TAG: ${{ matrix.mongodb-version == '7.0' && inputs.rc-docker-tag-alpine || inputs.rc-docker-tag }}

strategy:
fail-fast: false
matrix:
mongodb-version: ${{ fromJSON(inputs.mongodb-version) }}
shard: ${{ fromJSON(inputs.shard) }}

name: MongoDB ${{ matrix.mongodb-version }} (${{ matrix.shard }}/${{ inputs.total-shard }})${{ matrix.mongodb-version == '6.0' && ' - Alpine' || '' }}
name: MongoDB ${{ matrix.mongodb-version }} (${{ matrix.shard }}/${{ inputs.total-shard }})${{ matrix.mongodb-version == '7.0' && ' - Alpine' || '' }}

steps:
- name: Login to GitHub Container Registry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
fi;

curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update

packages-build:
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
release: ee
transporter: 'nats://nats:4222'
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
mongodb-version: "['4.4']"
mongodb-version: "['5.0']"
node-version: ${{ needs.release-versions.outputs.node-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
Expand All @@ -372,7 +372,7 @@ jobs:
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
shard: '[1, 2, 3, 4, 5]'
total-shard: 5
mongodb-version: "['4.4']"
mongodb-version: "['5.0']"
node-version: ${{ needs.release-versions.outputs.node-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
Expand Down Expand Up @@ -720,7 +720,7 @@ jobs:
fi;

curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update

# Makes build fail if the release isn't there
Expand Down
1 change: 0 additions & 1 deletion FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
- Incoming / Outgoing Webhooks
- Data Importer
- Import from Slack
- Import from Hipchat
- Slack Bridge
- Profiles
- Custom avatars
Expand Down
12 changes: 2 additions & 10 deletions apps/meteor/app/api/server/v1/im.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ API.v1.addRoute(

API.v1.addRoute(
['dm.messages.others', 'im.messages.others'],
{ authRequired: true },
{ authRequired: true, permissionsRequired: ['view-room-administration'] },
{
async get() {
if (settings.get('API_Enable_Direct_Message_History_EndPoint') !== true) {
Expand All @@ -404,10 +404,6 @@ API.v1.addRoute(
});
}

if (!(await hasPermissionAsync(this.userId, 'view-room-administration'))) {
return API.v1.unauthorized();
}

const { roomId } = this.queryParams;
if (!roomId) {
throw new Meteor.Error('error-roomid-param-not-provided', 'The parameter "roomId" is required');
Expand Down Expand Up @@ -483,13 +479,9 @@ API.v1.addRoute(

API.v1.addRoute(
['dm.list.everyone', 'im.list.everyone'],
{ authRequired: true },
{ authRequired: true, permissionsRequired: ['view-room-administration'] },
{
async get() {
if (!(await hasPermissionAsync(this.userId, 'view-room-administration'))) {
return API.v1.unauthorized();
}

const { offset, count }: { offset: number; count: number } = await getPaginationItems(this.queryParams);
const { sort, fields, query } = await this.parseJsonQuery();

Expand Down
Loading
Loading