fix: include custom_attributes on SSO Profile struct#100
Conversation
WorkOS.SSO.Profile.cast/1 silently dropped the custom_attributes field returned by /sso/token, leaving callers unable to read custom attributes configured on a connection. This breaks the documented migration away from raw_attributes (deprecated 2026-04-15) for callers that rely on IdP-issued claims such as the front-channel logout sid. Adds :custom_attributes to the struct (optional, may be nil when the connection has no custom attributes configured), mirroring the field handling in WorkOS.DirectorySync.Directory.User.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is a small, additive field that cannot break existing callers. The field is optional (not in No files require special attention. Important Files Changed
|
|
great, thanks! |
Summary
WorkOS.SSO.Profile.cast/1silently drops thecustom_attributesfield returned byPOST /sso/token, so callers cannot read custom attributes configured on a connection in the WorkOS Dashboard.This is the documented migration path away from
raw_attributes(deprecated 2026-04-15), andcustom_attributesis listed as a top-level field on the Profile object. Without this field on the struct, applications relying on IdP-issued claims (e.g. thesidclaim used for front-channel single logout) cannot complete the migration and remain broken after the deprecation date.Changes
:custom_attributestoWorkOS.SSO.Profile's@type,defstruct, andcast/1, immediately after:raw_attributes.@enforce_keys, type| nil) since the API omits it for connections without custom attributes configured.WorkOS.DirectorySync.Directory.User.Tests
get_profile_and_tokenandget_profilemock fixtures to include acustom_attributespayload.describeblock asserting the field is cast onto the struct.mix testandmix format --check-formattedclean.