From 55cc3e43a4ee521ab950464b7131d3e0c413ed91 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Sat, 29 Apr 2017 20:04:32 +1000 Subject: [PATCH] Exit with error if we don't have xmlsec1. This is a critical tool --- pinaxcon/settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index d0832844..7a103d8e 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -304,6 +304,10 @@ NOSE_ARGS = [ '--cover-package=registrasion.controllers,registrasion.models', ] +xmlsec_binary = '/usr/bin/xmlsec1' +if not os.path.isfile(xmlsec_binary): + sys.exit('ERROR: xmlsec1 binary missing, EXITING') + SAML_ATTRIBUTE_MAPPING = { 'uid': ('username', ), 'mail': ('email', ), @@ -311,7 +315,7 @@ SAML_ATTRIBUTE_MAPPING = { 'sn': ('last_name', ), } SAML_CONFIG = { - 'xmlsec_binary': '/usr/bin/xmlsec1', + 'xmlsec_binary': xmlsec_binary, 'entityid': saml2_entityid, 'attribute_map_dir': os.path.join(PACKAGE_ROOT, 'saml2/attribute-maps'), 'service': {