Skip to content

return information that user was banned #520

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

Conversation

MatousJobanek
Copy link
Contributor

@MatousJobanek MatousJobanek commented Mar 21, 2025

When user is banned, then instead of returning the "pending approval" state, the reg-service should return a forbidden error with information that the account was banned.

paired PR codeready-toolchain/toolchain-e2e#1141

KUBESAW-267

Copy link
Contributor

@fbm3307 fbm3307 left a comment

Choose a reason for hiding this comment

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

Looks good just some minor suggestion on text of the error.

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

Looks good. I would rephrase the message a bit though.

Copy link
Contributor

@metlos metlos left a comment

Choose a reason for hiding this comment

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

Looks good with the messaging changes @alexeykazakov proposed.

@alexeykazakov
Copy link
Contributor

You need to update the e2e-tests too :)

=== RUN   TestUserManagement/TestUserBanning/register_new_user_with_preexisting_ban
    banneduser.go:21: BannedUser 'testuserb915aabc-087f-4bd9-a851-649753f05e9b@test.com' created
    user_management_test.go:653: 
        	Error Trace:	/tmp/toolchain-e2e/test/e2e/user_management_test.go:653
        	            				/go/pkg/mod/github.com/stretchr/testify@v1.10.0/suite/suite.go:115
        	Error:      	Not equal: 
        	            	expected: "forbidden: user has been banned"
        	            	actual  : "forbidden: Access to the Developer Sandbox has been suspended due to suspicious activity or detected abuse."
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-forbidden: user has been banned
        	            	+forbidden: Access to the Developer Sandbox has been suspended due to suspicious activity or detected abuse.
        	Test:       	TestUserManagement/TestUserBanning/register_new_user_with_preexisting_ban

@MatousJobanek
Copy link
Contributor Author

Yeah, I looked only at the registration-service test file and I didn't find anything relevant there. I missed the user-management one - done in codeready-toolchain/toolchain-e2e#1141

@MatousJobanek
Copy link
Contributor Author

/retest
OLM failed

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.09%. Comparing base (deee157) to head (ac0a1b7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #520   +/-   ##
=======================================
  Coverage   81.09%   81.09%           
=======================================
  Files          43       43           
  Lines        3517     3518    +1     
=======================================
+ Hits         2852     2853    +1     
  Misses        578      578           
  Partials       87       87           
Flag Coverage Δ
unittests 81.09% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link

openshift-ci bot commented Mar 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, fbm3307, MatousJobanek, metlos, mfrancisc, rajivnathan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,fbm3307,metlos,mfrancisc,rajivnathan]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@MatousJobanek MatousJobanek merged commit ce4d325 into codeready-toolchain:master Mar 28, 2025
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants