-
Notifications
You must be signed in to change notification settings - Fork 34
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
How to use User Enterprise extension schema? #48
Comments
I had the same problem.
I added the following code to try it out and it worked as I expected. attribute_tree = []
resource_class.extended_schemas.each do |schema|
attribute_tree << schema.id and break if schema.scim_attributes.any? { |attribute| attribute.name == scim_attribute.to_s }
end
attribute_tree << scim_attribute.to_s
sub_scim_hash_or_leaf_value = scim_hash_or_leaf_value&.dig(*attribute_tree) If there is a way to make it work correctly without doing this, please let me know. |
@MorrisFreeman have you made a fork? |
@bettysteger |
@MorrisFreeman i made one for v1: #49 |
Sorry for the slow response. In addition to your PR, I'm building bunch of test coverage that'll the incorporate it, so we've got overall better support for extended schema. Within that, a failure does alert me to a missing initialiser from your example class which is included in the comment you referenced. Without this, schema enumeration via def initialize(options = {})
super(
name: 'ExtendedUser',
description: 'Enterprise extension for a User',
id: self.class.id,
scim_attributes: self.class.scim_attributes
)
end I'll follow up with more once I've got the tests etc. all sorted out; V2 initially, but as usual I'll backport to V1. |
So #50 is an attempt to get #49 into a branch form for merge onto V2 as a v2.4.1 path release, but is in draft as I write this because I want to add additional documentation to cover the use of extension schema without having to resort to reading comments in code! Although V2 (merging to |
By the way, I just noticed from the RFC that |
@pond thanks for the response, yes i know about the |
Closed by #50. See:
Thanks again for the contribution |
I feel bad opening a new issue here, but i tried a few hours and could not make it work, i did what is described here to extend the User schema.
I've got this in my
config/initalizers/scimitar.rb
:Creating the extended schema works, but the user attribute mapping is giving me a
nil
value... When using it like this in my user model:When i do not add
organization: :property_name
in thescim_attributes_map
method, theproperty_name=
method is not called, but when i add it, the value is nil (so i guess some parts do work)! When i output the SCIM hash, I have a string value for the organization:So the value should in fact be "Property name". Am i doing something wrong here?
Unfortunately there is no documenation about extending the User Schema, and i would need the
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User
from the SCIM specification at https://www.rfc-editor.org/rfc/rfc7643#section-4.3.The text was updated successfully, but these errors were encountered: