wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

`type` sub attribute is not needed for `users` and `groups` attributes of Role resource #12554

Closed AnuradhaSK closed 2 weeks ago

AnuradhaSK commented 3 years ago

Describe the issue: Role resource has two attributes as users and groups. their sub-attributes as follows. type subattribute is not needed for these attributes.

sub-attributes of users: display, value,$ref , type https://github.com/wso2/charon/blame/master/modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMSchemaDefinitions.java#L1064

sub-attributes of groups: display, value,$ref , type https://github.com/wso2/charon/blame/master/modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMSchemaDefinitions.java#L1074

Anyway, that subattribute doesn't return in Role resource response. but need to remove in code

Response of the Role retrieval:

{
    "displayName": "Developer",
    "meta": {
        "location": "https://localhost:9443/scim2/Roles/e8258724-b7b4-430b-a7d5-49595c273b85"
    },
    "permissions": [
        "/permission/admin/login"
    ],
    "schemas": [
        "urn:ietf:params:scim:schemas:extension:2.0:Role"
    ],
    "groups": [
        {
            "display": "PRIMARY/EngineeringTeam",
            "value": "fba64a51-5b6a-429f-89f3-1758a7ab836f",
            "$ref": "https://localhost:9443/scim2/Groups/fba64a51-5b6a-429f-89f3-1758a7ab836f"
        }
    ],
    "id": "e8258724-b7b4-430b-a7d5-49595c273b85",
    "users": [
        {
            "display": "alex",
            "value": "d7360199-f48e-45b5-8251-de4e5ea4b209",
            "$ref": "https://localhost:9443/scim2/Users/d7360199-f48e-45b5-8251-de4e5ea4b209"
        }
    ]
}

Expected behavior:

Environment information (Please complete the following information; remove any unnecessary fields) :

AnuradhaSK commented 3 years ago

In case type is a needed subattribute this issue need to be fixed.

https://github.com/wso2/charon/blame/master/modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMSchemaDefinitions.java#L999 SCIMConstants.RoleSchemaConstants.USERS_TYPE_URI should be used instead of SCIMConstants.RoleSchemaConstants.GROUPS_TYPE_URI

isharak commented 2 weeks ago

This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!