Conversation
| Fingerprinter.fingerprint_cert(matching_cert || current_service_provider.ssl_certs.first) | ||
| saml_request.service_provider.fingerprint = matching_cert ? | ||
| Fingerprinter.fingerprint_cert(matching_cert) : | ||
| 'some-non-nil-value' |
There was a problem hiding this comment.
I don't fully understand the library, but to avoid the magic string, could we do
if matching_cert
saml_request.service_provider.fingerprint = Fingerprinter.fingerprint_cert(matching_cert)
endThere was a problem hiding this comment.
the library gets cranky if .fingerprint is nil, so that's what I'm trying to avoid at all costs
There was a problem hiding this comment.
I guess my confusion is we weren't setting fingerprint before, so it was getting set somewhere? If we need to override we can with the if, and if there's no matching cert, it feels like we should error earlier in the request.
There was a problem hiding this comment.
We used to pass fingerprint every time: https://github.com/18F/identity-idp/pull/4851/files#diff-fdfe3f731c3c1bb52752814efbd9b353dec85fca38e11f0ccc05e8622b9893beL29-L31
But since fingerprint is tied to a specific cert, we can't do that for multiple certs
There was a problem hiding this comment.
(wrong place to comment)
|
Before multi-cert, we had this line which checked |
|
Or change: ...to: @ssl_certs ||= (certs.presence || Array(cert).compact).map do |cert| |
|
@aduth |
Based on the stack trace from the errors, I think that the nil/blank data is coming from the request when we try to validate it, not from us having blank data inside here |
My thinking was that if And |
Not exactly! 😬 irb(main):008:0> Array(nil)
=> [] |
🤦 |
|
Lol - whee Ruby! |
|
Closing in favor of #4898 |
I had some trouble building a request that generated the same error we saw in prod, so I went the route of stubbing something inside the IDP gem and then catching all the places