Modify is_lasso_ecp_enabled() to test for library symbol
authorJohn Dennis <jdennis@redhat.com>
Mon, 14 Sep 2015 21:24:23 +0000 (17:24 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Wed, 16 Sep 2015 11:11:08 +0000 (13:11 +0200)
The function is_lasso_ecp_enabled() in saml2idp.py was testing for a
specific lasso version. That has proved problematic because we've had
too many "unofficial" versions floating around and sometimes the
version check produces the wrong result.

A better test is to test for the presence of a symbol in the lasso
library we know will only be there with full ECP support.

Now we test for the presence of ECP_ERROR_MISSING_AUTHN_REQUEST.

Ticket: 167
Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/providers/saml2idp.py

index d4f3a31..0404fe8 100644 (file)
@@ -28,8 +28,8 @@ cherrypy.tools.require_content_type = cherrypy.Tool('before_request_body',
 
 
 def is_lasso_ecp_enabled():
-    # Full ECP support appeared in lasso version 2.4.2
-    return lasso.checkVersion(2, 4, 2, lasso.CHECK_VERSION_NUMERIC)
+    # Look for an exported symbol we know was added with ECP support
+    return 'ECP_ERROR_MISSING_AUTHN_REQUEST' in dir(lasso)
 
 
 class SSO_SOAP(AuthenticateRequest):