Add Support for custom attributes#180
Add Support for custom attributes#180Avinash-Kamath wants to merge 7 commits intoelimity-com:masterfrom
Conversation
|
Thanks for the contribution! I understand the need: IdPs like Okta and Azure do send custom attributes outside the standard SCIM schema, and that's a real pain point. However, I can't merge this as-is for a few reasons: SCIM compliance. RFC 7643 defines that resource attributes must be described by schemas. The SCIM-compliant way to handle custom/non-standard attributes is through schema extensions ( Unvalidated input passthrough. The current implementation copies any unrecognized key from the raw JSON into the attributes map without validation. This could allow clients to inject keys like Test side effects. Setting A few smaller things:
Next steps: Could you open an issue describing the use case and the IdP behaviors you're working around? That way we can discuss the right approach, likely improving the ergonomics of |
Issue
IDP like OKTA, Azure support custom attributes along with scim attributes. Today Resource type validations will drop all non-scim compliant attributes during validation
Solution
Adding a flag to allow non-SCIM compliant attributes, updating the validation logic to include these attributes
Support for custom attributes:
resource_type.go: AddedAllowNonScimKeysflag toResourceTypeto allow non-SCIM compliant attributes. Updated thevalidatemethod to include these attributes in the resource type. [1] [2]Testing enhancements:
handlers_test.go: Added theAllowNonScimKeysflag to thenewTestServerfunction and created a new testTestServerResourceHandlerWithCustomAttributesto verify the handling of custom attributes. [1] [2]utils_test.go: Added a helper functionassertEqualMapsto compare maps in tests.