-
Notifications
You must be signed in to change notification settings - Fork 788
Multiple project owner backend #4774
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
Merged
Saranya-jena
merged 24 commits into
litmuschaos:master
from
aryan-bhokare:multiple-project-owner-backend
Jul 22, 2024
Merged
Multiple project owner backend #4774
Saranya-jena
merged 24 commits into
litmuschaos:master
from
aryan-bhokare:multiple-project-owner-backend
Jul 22, 2024
Conversation
This file contains hidden or 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
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
…itmuschaos#4527) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0. - [Commits](golang/crypto@v0.18.0...v0.21.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4. - [Release notes](https://github.com/golang/protobuf/releases) - [Commits](golang/protobuf@v1.5.3...v1.5.4) --- updated-dependencies: - dependency-name: github.com/golang/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com>
This modification unables to send invite with the role as owner. Signed-off-by: aryan <aryan1bhokare@gmail.com>
This modification checks if the User is the last owner of the project and if not User can leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com>
Allows Owner to be able to leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com>
This API is used for updating role of the member in the project. Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Owner can delete project with help of this API. Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
…kend Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
User cannot change role of their own, so that it will avoid edge cases like 1. User is the last owner of the project. 2. User accidentally losing owner access to the projects. Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
| // Filter the members to include only the owners | ||
| var owners []*entities.Member | ||
| for _, member := range project.Members { | ||
| if member.Role == entities.RoleOwner && member.Invitation == entities.AcceptedInvitation { |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
This query depends on a [user-provided value](1).
This query depends on a [user-provided value](2).
| return nil | ||
| } | ||
|
|
||
| // GetAggregateProjects takes a mongo pipeline to retrieve the project details from the database |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
This query depends on a [user-provided value](1).
| if result.DeletedCount == 0 { | ||
| return errors.New("no project found with the given projectID") | ||
| } | ||
|
|
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
This query depends on a [user-provided value](1).
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
Saranya-jena
approved these changes
Jul 18, 2024
SarthakJain26
approved these changes
Jul 18, 2024
andoriyaprashant
pushed a commit
to andoriyaprashant/litmus
that referenced
this pull request
Sep 7, 2024
* Modified db schema of Owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API GetProjectOwners. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fix: return type error. Signed-off-by: aryan <aryan1bhokare@gmail.com> * chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0. - [Commits](golang/crypto@v0.18.0...v0.21.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493) Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4. - [Release notes](https://github.com/golang/protobuf/releases) - [Commits](golang/protobuf@v1.5.3...v1.5.4) --- updated-dependencies: - dependency-name: github.com/golang/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> * Modified SendInvitation API. This modification unables to send invite with the role as owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Modified LeaveProject API. This modification checks if the User is the last owner of the project and if not User can leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * RBAC modification `LeaveProject`. Allows Owner to be able to leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added `UpdateMemberRole` API. This API is used for updating role of the member in the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Fixed some syntax errors. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Updated roles for owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API `DeleteProject`. Owner can delete project with help of this API. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added mocks. Signed-off-by: aryan <aryan1bhokare@gmail.com> * modified go.sum Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added condition `UpdateMemberRole`. User cannot change role of their own, so that it will avoid edge cases like 1. User is the last owner of the project. 2. User accidentally losing owner access to the projects. Signed-off-by: aryan <aryan1bhokare@gmail.com> * made suggested changes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Changed DeleteProject endpoint to have url parameter. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Minor fixes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixed import orders Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixing RoleEditor to RoleExecuter Signed-off-by: aryan <aryan1bhokare@gmail.com> --------- Signed-off-by: aryan <aryan1bhokare@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> Co-authored-by: Saranya Jena <saranya.jena@harness.io> Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
andoriyaprashant
pushed a commit
to andoriyaprashant/litmus
that referenced
this pull request
Sep 7, 2024
* Modified db schema of Owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API GetProjectOwners. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fix: return type error. Signed-off-by: aryan <aryan1bhokare@gmail.com> * chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0. - [Commits](golang/crypto@v0.18.0...v0.21.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493) Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4. - [Release notes](https://github.com/golang/protobuf/releases) - [Commits](golang/protobuf@v1.5.3...v1.5.4) --- updated-dependencies: - dependency-name: github.com/golang/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> * Modified SendInvitation API. This modification unables to send invite with the role as owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Modified LeaveProject API. This modification checks if the User is the last owner of the project and if not User can leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * RBAC modification `LeaveProject`. Allows Owner to be able to leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added `UpdateMemberRole` API. This API is used for updating role of the member in the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Fixed some syntax errors. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Updated roles for owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API `DeleteProject`. Owner can delete project with help of this API. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added mocks. Signed-off-by: aryan <aryan1bhokare@gmail.com> * modified go.sum Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added condition `UpdateMemberRole`. User cannot change role of their own, so that it will avoid edge cases like 1. User is the last owner of the project. 2. User accidentally losing owner access to the projects. Signed-off-by: aryan <aryan1bhokare@gmail.com> * made suggested changes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Changed DeleteProject endpoint to have url parameter. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Minor fixes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixed import orders Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixing RoleEditor to RoleExecuter Signed-off-by: aryan <aryan1bhokare@gmail.com> --------- Signed-off-by: aryan <aryan1bhokare@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> Co-authored-by: Saranya Jena <saranya.jena@harness.io> Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
sagnik3788
pushed a commit
to sagnik3788/litmus
that referenced
this pull request
Oct 5, 2024
* Modified db schema of Owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API GetProjectOwners. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fix: return type error. Signed-off-by: aryan <aryan1bhokare@gmail.com> * chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0. - [Commits](golang/crypto@v0.18.0...v0.21.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493) Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4. - [Release notes](https://github.com/golang/protobuf/releases) - [Commits](golang/protobuf@v1.5.3...v1.5.4) --- updated-dependencies: - dependency-name: github.com/golang/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> * Modified SendInvitation API. This modification unables to send invite with the role as owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Modified LeaveProject API. This modification checks if the User is the last owner of the project and if not User can leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * RBAC modification `LeaveProject`. Allows Owner to be able to leave the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added `UpdateMemberRole` API. This API is used for updating role of the member in the project. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Fixed some syntax errors. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Updated roles for owner. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added new API `DeleteProject`. Owner can delete project with help of this API. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added mocks. Signed-off-by: aryan <aryan1bhokare@gmail.com> * modified go.sum Signed-off-by: aryan <aryan1bhokare@gmail.com> * Added condition `UpdateMemberRole`. User cannot change role of their own, so that it will avoid edge cases like 1. User is the last owner of the project. 2. User accidentally losing owner access to the projects. Signed-off-by: aryan <aryan1bhokare@gmail.com> * made suggested changes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Changed DeleteProject endpoint to have url parameter. Signed-off-by: aryan <aryan1bhokare@gmail.com> * Minor fixes. Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixed import orders Signed-off-by: aryan <aryan1bhokare@gmail.com> * fixing RoleEditor to RoleExecuter Signed-off-by: aryan <aryan1bhokare@gmail.com> --------- Signed-off-by: aryan <aryan1bhokare@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raj Das <mail.rajdas@gmail.com> Co-authored-by: Saranya Jena <saranya.jena@harness.io> Signed-off-by: sagnik3788 <116512372+sagnik3788@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #3958 #4161
Proposed changes
Work done:
GetProjectOwners.SendInvitationAPI.LeaveProjectAPI.UpdateMemberRole.DeleteProject.Types of changes
What types of changes does your code introduce to Litmus? Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
Special notes for your reviewer: