Skip to content

ReplaceResource overwrite of input resource causes unexpected results #58

@nabowler

Description

@nabowler

Our implementation of the SCIM Server does not return the Address Display field. When replacing a user with multiple addresses that have had their Display field set on the Client side, the Display values of the Addresses are not guaranteed to be correct, or empty, after calling ReplaceResource

Addresses before ReplaceResource

[
  {
    "country": "AU",
    "streetAddress": "123 Stuart St",
    "locality": "State College",
    "region": "Tasmania",
    "postalCode": "16801-6139",
    "type": "MAILING",
    "formatted": "123 Stuart St\n\n State College Tasmania 16801-6139",
    "display": "123 Stuart St\n\n State College Tasmania 16801-6139"
  },
  {
    "country": "US",
    "streetAddress": "123 Stuart St",
    "locality": "State College",
    "region": "PA",
    "postalCode": "16801-6139",
    "type": "PERMANENT",
    "formatted": "123 Stuart St\n\n State College PA 16801-6139",
    "display": "123 Stuart St\n\n State College PA 16801-6139"
  },
  {
    "country": "US",
    "locality": "State College",
    "postalCode": "16801-6139",
    "region": "PA",
    "streetAddress": "300 Science Park Rd",
    "formatted": "300 Science Park Rd\n\n State College PA 16801-6139",
    "addressInvalid": false,
    "type": "UNIVERSITY",
    "display": "300 Science Park Rd\n\n State College PA 16801-6139"
  },
  {
    "country": "US",
    "locality": "University Park",
    "postalCode": "16802",
    "region": "PA",
    "streetAddress": "Brumbaugh Hall 0609",
    "formatted": "Brumbaugh Hall 0609\n\n University Park PA 16802",
    "addressInvalid": false,
    "type": "DORM",
    "key": "194510",
    "display": "Brumbaugh Hall 0609\n\n University Park PA 16802"
  }
]

Addresses after ReplaceResource

[
  {
    "key": "19633",
    "type": "PERMANENT",
    "display": "123 Stuart St\n\n State College Tasmania 16801-6139",
    "country": "US",
    "formatted": "123 Stuart St\nState College, PA 16801-6139 US",
    "locality": "State College",
    "postalCode": "16801-6139",
    "region": "PA",
    "streetAddress": "123 Stuart St"
  },
  {
    "key": "194510",
    "type": "DORM",
    "display": "123 Stuart St\n\n State College PA 16801-6139",
    "country": "US",
    "formatted": "Brumbaugh Hall 0609\nUniversity Park, PA 16802 US",
    "locality": "University Park",
    "postalCode": "16802",
    "region": "PA",
    "streetAddress": "Brumbaugh Hall 0609"
  },
  {
    "key": "170039",
    "type": "MAILING",
    "display": "300 Science Park Rd\n\n State College PA 16801-6139",
    "country": "AU",
    "formatted": "123 Stuart St\nState College, Tasmania 16801-6139 AU",
    "locality": "State College",
    "postalCode": "16801-6139",
    "region": "Tasmania",
    "streetAddress": "123 Stuart St"
  },
  {
    "key": "182012",
    "type": "UNIVERSITY",
    "display": "Brumbaugh Hall 0609\n\n University Park PA 16802",
    "country": "US",
    "formatted": "300 Science Park Rd\nState College, PA 16801-6139 US",
    "locality": "State College",
    "postalCode": "16801-6139",
    "region": "PA",
    "streetAddress": "300 Science Park Rd"
  }
]

The display no longer match the formatted because they are preserved during the json Unmarshal, but the response ordering is arbitrary.

This has the possibility to affect other fields besides display.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions