Skip to content

Remove #is_a? call from VTR in SAML request validator#10688

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-remove-vtr-is-a-array
May 23, 2024
Merged

Remove #is_a? call from VTR in SAML request validator#10688
jmhooper merged 2 commits intomainfrom
jmhooper-remove-vtr-is-a-array

Conversation

@jmhooper
Copy link
Contributor

When I was working on the code to parse a VTR in the SAML request validator I copied the code from the OIDC form object. This included a check that the vtr is an array. In OIDC that is necessarily because we are directly parsing the result of calling JSON.parse on the param. In SAML that is not the case; the vtr is parsed out of the authn request and will be an array or nil. For this reason we can use #blank? in the SAML implementation.

When I was working on the code to parse a VTR in the SAML request validator I copied the code from the OIDC form object. This included a check that the `vtr` is an array. In OIDC that is necessarily because we are directly parsing the result of calling `JSON.parse` on the param. In SAML that is not the case; the vtr is parsed out of the authn request and will be an array or nil. For this reason we can use `#blank?` in the SAML implementation.

[skip changelog]
@jmhooper jmhooper requested a review from zachmargolis May 23, 2024 14:37
@jmhooper jmhooper merged commit f05eaff into main May 23, 2024
@jmhooper jmhooper deleted the jmhooper-remove-vtr-is-a-array branch May 23, 2024 18:00
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.

2 participants