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

Duplicate id in resource location #12

Open
jehervy opened this issue Jun 29, 2022 · 0 comments
Open

Duplicate id in resource location #12

jehervy opened this issue Jun 29, 2022 · 0 comments

Comments

@jehervy
Copy link

jehervy commented Jun 29, 2022

Hi,

We spotted that the resource id is duplicate in the location property when we get a resource by id :

[~]$ curl -X GET "http://localhost:7750/scim/v2/Users/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8" -H "accept: */*" -s | jq
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "3ffe7ac4-f0bf-41ca-8c41-59839f5991e8",
  "meta": {
    "created": "2022-06-15T07:20:22.522Z",
    "lastModified": "2022-06-21T15:32:28.111Z",
    "resourceType": "User",
    "location": "https://localhost:7750/scim/v2/Users/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8/3ffe7ac4-f0bf-41ca-8c41-59839f5991e8"
  }
}

It seems that the baseUri given to the ResourcePreparer already contains the resource id (see here).
And then the ResourcePreparer adds it again when the location is computed (see here).

For information, the endpoint is defined the following way :

@GetMapping(value = "/{id}")
public GenericScimResource get(@PathVariable("id") final String id,
                               @RequestParam(name = "attributes", required = false) String attributes,
                               @RequestParam(name = "excludedAttributes", required = false) String excludedAttributes)
        throws BadRequestException {
    return genericScimResourceConverter.convert(
            attributes,
            excludedAttributes,
            userService.getUser(id));
}
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

No branches or pull requests

1 participant