Skip to content

[WPB-22287] fix saml xml headers#4898

Merged
fisx merged 5 commits intodevelopfrom
WPB-22287-fix-saml-xml-headers
Dec 11, 2025
Merged

[WPB-22287] fix saml xml headers#4898
fisx merged 5 commits intodevelopfrom
WPB-22287-fix-saml-xml-headers

Conversation

@fisx
Copy link
Contributor

@fisx fisx commented Dec 10, 2025

https://wearezeta.atlassian.net/browse/WPB-22287

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@fisx fisx requested review from a team as code owners December 10, 2025 12:14
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 10, 2025
Comment on lines 90 to 111
parseText def
$ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
<> "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
<> " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
<> "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">"
<> "<body onload=\"document.forms[0].submit()\">"
<> "<noscript>"
<> "<p>"
<> "<strong>Note:</strong>Since your browser does not support JavaScript,"
<> " you must press the Continue button once to proceed."
<> "</p>"
<> "</noscript>"
<> "<form action=\"https://ServiceProvider.com/SAML/SLO/Browser/%25%25\""
<> " method=\"post\" accept-charset=\"utf-8\">"
<> "<input type=\"hidden\" name=\"SAMLRequest\""
<> " value=\"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbHA6TG9nb3V0UmVxdWVzdCBJRD0iZDJiN2MzODhjZWMzNmZhN2MzOWMyOGZkMjk4NjQ0YTgiIElzc3VlSW5zdGFudD0iMjAwNC0wMS0yMVQxOTowMDo0OVoiIFZlcnNpb249IjIuMCIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCI+ICAgIDxJc3N1ZXIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPmh0dHBzOi8vSWRlbnRpdHlQcm92aWRlci5jb20vU0FNTDwvSXNzdWVyPiAgICA8TmFtZUlEIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6cGVyc2lzdGVudCIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPjAwNWEwNmUwLWFkODItMTEwZC1hNTU2LTAwNDAwNWIxM2EyYjwvTmFtZUlEPiAgICA8c2FtbHA6U2Vzc2lvbkluZGV4PjE8L3NhbWxwOlNlc3Npb25JbmRleD48L3NhbWxwOkxvZ291dFJlcXVlc3Q+\"/>"
<> "<noscript>"
<> "<input type=\"submit\" value=\"Continue\"/>"
<> "</noscript>"
<> "</form>"
<> "</body>"
<> "</html>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter doesn't seem to be happy with this: https://concourse.ops.zinfra.io/builds/113705858#L6925182b:20

Are you using Ormolu?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no, the ormolu poltergeist from saml2-web-sso has re-emerged, and this time on another dev machine! i guess it's time to fix it?

Copy link
Contributor

@supersven supersven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to approve changes while the CI is failing... 🤔

However, please feel free to get back to me on this. (I now know what this is about, so I might be quick in approving. 😉 )

encode = Text.XML.renderText settings . renderToDocument
where
settings = def {rsNamespaces = nameSpaces (Proxy @a), rsXMLDeclaration = False}
settings = def {rsNamespaces = nameSpaces (Proxy @a), rsXMLDeclaration = True}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either this should let some tests fail (CI is unfortunately blocked by the linting error) or one should be written 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is one meaningfully failling: https://concourse.ops.zinfra.io/builds/113707705#L69251a57:1358

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was one failing test which i fixed (and thereby broke ormolu). why would you expect other tests to fail? any ones in particular? (i'm asking, but i really should be looking for some myself...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, found some more tests that fail! thanks concourse! :-)

@fisx fisx requested a review from supersven December 11, 2025 08:46
@fisx fisx merged commit e219f52 into develop Dec 11, 2025
8 of 10 checks passed
@fisx fisx deleted the WPB-22287-fix-saml-xml-headers branch December 11, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants