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

Client error responses of user sharing API should be returned as JSON responses #22596

Closed
AnuradhaSK opened this issue Jan 29, 2025 · 1 comment

Comments

@AnuradhaSK
Copy link
Contributor

AnuradhaSK commented Jan 29, 2025

Description

Some Error scenario related responses of user sharing API are not returned in JSON format.
Check all similar flows and fix them.

Steps to Reproduce

Start an IS and try the following curl without any setting up. No need to have any users or roles as mentioned here.

curl --location 'https://localhost:9443/t/carbon.super/api/server/v1/users/share' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data '{
    "userCriteria": {
        "userIds": [
            "f6990206-08c4-4629-aa6c-38d70698ef82"
        ]
    },
    "organizations": [
        {
            "orgId": "0e3a5ae7-e42a-4938-84d7-6060f4af0613",
            "policy": "SELECTED_ORG_ONLY",
            "roles": [
                {
                    "displayName": "app-role-1",
                    "audience": {
                        "display": "App1",
                        "type": "application"
                    }
                },
                {
                    "displayName": "org-role-1",
                    "audience": {
                        "display": "Super",
                        "type": "organization"
                    }
                }
            ]
        }
    ]
}'

response body has Sharing beyond immediate child organizations is not allowed.
It should be returned as a JSON response with error code, error message and error description. If trace id available that also should be there.

Image

Version

IS-7.1.0-alpha

Environment Details (with versions)

No response

@BimsaraBodaragama
Copy link
Member

You can track the PR here.

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

No branches or pull requests

2 participants