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

Update request comes even if attributes are unchanged for extension schema attributes #155

Open
anurag55 opened this issue Jan 27, 2025 · 0 comments

Comments

@anurag55
Copy link

anurag55 commented Jan 27, 2025

Custom schema attributes are included in update request params even if there is no change for attributes.

Example request:

Processing by Scim::V2::UsersController#update as HTML
Parameters: {"schemas"=>["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations"=>[{"op"=>"Add", "path"=>"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber", "value"=>"SCAD1234"}, {"op"=>"Add", "path"=>"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department", "value"=>"Vendor / Consultants"}], "id"=>"32"}

So both employeeNumber and Department mapped throgh scim mapping.

def self.scim_attributes_map
  {
    id:         :id,
    userName:   :email,
    employeeNumber: :employee_number,
    department: :department,
    displayName:   :position_title,
  }
end

User Extension class

def self.scim_attributes
  [
    Scimitar::Schema::Attribute.new(name: "employeeNumber", type: "string"),
    Scimitar::Schema::Attribute.new(name: "department",   type: "string"),
  ]
end

So my issue is, it works for the fields available in base schema like displayName, but it doesn't works for fields in extension schema and always triggers an update request even if no changes are made for those attributes.

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