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

Fix: SCIM error message for invalid request values in V1 and V2 Roles Remove-Add-Replace operations (fixes #20334) #559

Merged

Conversation

BimsaraBodaragama
Copy link
Contributor

Purpose

Fix SCIM error handling to provide appropriate messages when a group display name is used instead of a group ID.

Goals

To ensure compliance with RFC 7644 and provide clear, actionable error messages to users when an invalid request is made with a group display name.

Approach

  • Implemented error response with scimType set to invalidSyntax for requests using a group display name instead of a group ID.
  • Provided a clear and concise error message in the detail field.
  • Handled the fix for both V1 and V2 roles.
  • Ensured the error response adhered to the SCIM specification.

Issue

Resolves #20334

…Remove-Add-Replace operations (fixes #20334)
@BimsaraBodaragama BimsaraBodaragama requested a review from dhaura July 2, 2024 09:51
@BimsaraBodaragama BimsaraBodaragama self-assigned this Jul 2, 2024
@jenkins-is-staging
Copy link

@Mock
private RoleManagementService roleManagementService;
@Mock
private SCIMRoleManagerV2 scimRoleManagerV2;
Copy link
Contributor

Choose a reason for hiding this comment

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

we should not mock the class which the method we are testing

Copy link
Contributor Author

@BimsaraBodaragama BimsaraBodaragama Jul 5, 2024

Choose a reason for hiding this comment

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

Fixed by e15eeb8 and c8cf26b

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9803713898
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/9803713898


import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.testng.AssertJUnit.assertEquals;
Copy link
Contributor

@AnuradhaSK AnuradhaSK Jul 5, 2024

Choose a reason for hiding this comment

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

Suggested change
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.Assert;

Let's import org.testng.Assert and use its assertEquals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by e97c090

@AnuradhaSK AnuradhaSK merged commit 4748551 into wso2-extensions:master Jul 5, 2024
2 checks passed
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.

Non descriptive error message for SCIM Roles v2 patch operation
3 participants