Commit d5cfabb
test(saml): the "accepts signed assertion" case was passing vacuously
It asserted only that Location did not contain "/auth/failure". A rejection
returns 400 with NO Location, so the expression evaluated to
`nil.should_not be_true` — which passes. The case reported green while the
assertion was in fact being refused, which is exactly backwards for a test
whose job is to prove acceptance.
Rewritten to assert the thing that matters: a UserAuthLookup is created.
That correctly FAILS today, so it is marked pending against two independent
crystal-saml bugs, both confirmed by experiment rather than inspection:
1. validate_signature serialises SignedInfo via XML::Node#to_xml, losing
the namespace it INHERITS when the IdP declares xmldsig as a DEFAULT
namespace on <Signature> — which is what real IdPs emit (mock-saml,
Azure AD, ADFS). The canonical bytes then differ from the signer's and
every real-world signature fails. Fix written and verified locally
(false -> true against a live mock-saml assertion); awaiting push access.
2. sign_document writes its `uuid` ARGUMENT into Reference URI instead of
the signed element's ID, so verify_digest can never resolve the
referenced element. The library's own sign->verify round trip has never
worked — verified against unmodified code, so it predates (1).
Marking pending keeps the intent recorded without reporting a false green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 4e1d709 commit d5cfabb
1 file changed
Lines changed: 26 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
225 | 247 | | |
226 | | - | |
| 248 | + | |
227 | 249 | | |
228 | | - | |
229 | | - | |
| 250 | + | |
| 251 | + | |
230 | 252 | | |
231 | 253 | | |
232 | 254 | | |
| |||
0 commit comments