Skip to content

Fix invitation acceptance logic and update permission constant naming #2803

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SammyOina
Copy link
Contributor

@SammyOina SammyOina commented Apr 9, 2025

What type of PR is this?

What does this do?

  • Refactor
    • Enhanced the invitation acceptance flow with improved validation and authorization checks for a more secure process.
  • Style
    • Updated permission naming to adhere to consistent coding standards.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Did you document any new/modified feature?

Notes

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
@SammyOina SammyOina requested a review from a team as a code owner April 9, 2025 11:02
Copy link

codecov bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 28.28%. Comparing base (af8caa4) to head (8437624).

Files with missing lines Patch % Lines
domains/middleware/authorization.go 0.00% 7 Missing ⚠️
domains/roleoperations.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2803      +/-   ##
==========================================
+ Coverage   27.55%   28.28%   +0.73%     
==========================================
  Files         351       30     -321     
  Lines       55347     5462   -49885     
==========================================
- Hits        15251     1545   -13706     
+ Misses      39340     3822   -35518     
+ Partials      756       95     -661     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@@ -42,7 +42,7 @@ const (
readPermission = "read_permission"
deletePermission = "delete_permission"
manageRolePermission = "manage_role_permission"
addRoleUsersPermission = "add_role_users_permission"
AddRoleUsersPermission = "add_role_users_permission"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this operations is needed some where else ? Why it is exported ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

if err := am.extAuthorize(ctx, auth.EncodeDomainUserID(domainID, inv.InvitedBy), domains.AddRoleUsersPermission, policies.DomainType, domainID); err == nil {
		return err
	}
	```

@dborovcanin
Copy link
Collaborator

@SammyOina Please rebase.

@dborovcanin
Copy link
Collaborator

@SammyOina Please rebase. @arvindh123 Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Missing critical middleware checks when adding user via invitation
3 participants