Skip to content

fix: preserve SAML attribute statements on create and update - #70

Open
mjdavidson wants to merge 1 commit into
okta:mainfrom
mjdavidson:fix/saml-attribute-statements-dropped
Open

fix: preserve SAML attribute statements on create and update#70
mjdavidson wants to merge 1 commit into
okta:mainfrom
mjdavidson:fix/saml-attribute-statements-dropped

Conversation

@mjdavidson

Copy link
Copy Markdown

SAML attributeStatements were dropped (returned as []) on both create and update. _build_application_model built the SDK model with the plain constructor, which leaves the SamlAttributeStatement anyOf union's actual_instance unset, so each statement serialized to null and never reached Okta. Builds the model via the SDK's from_dict, which binds the union members; other application types are unaffected.\n\nTests: tests/test_application_model.py.

_build_application_model built the SDK model with Model(**app_config). For SAML
apps, settings.signOn.attributeStatements is a list of SamlAttributeStatement,
an anyOf union whose concrete member (expression/group) is only bound by the
SDK's from_dict deserializer. The plain constructor left each union's
actual_instance as None, so every attribute statement serialized to null and
never reached Okta — created and updated SAML apps always came back with an
empty attributeStatements list, and assertions carried only the NameID.

Build the model via model_cls.from_dict(app_config) instead, which binds nested
union members. Attribute statements now round-trip with their full content;
other application types are unaffected (from_dict is the SDK's own deserializer).
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

Successfully merging this pull request may close these issues.

1 participant