From 93f8b55a8648ab2c9a629048746047fa07a09fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Mon, 2 Jun 2014 23:35:58 +0200 Subject: [PATCH] manage sso and slo --- .gitignore | 3 + conf.d/linuxfr_saml_example | 11 --- conf.d/portatil_famille | 2 +- rp_meyzieu/filters/portail_famille_ecitiz.py | 20 ++++- rp_meyzieu/mappers/linuxfr_example.py | 85 ------------------- rp_meyzieu/mappers/portail_famille_ecities.py | 25 +++++- 6 files changed, 47 insertions(+), 99 deletions(-) create mode 100644 .gitignore delete mode 100644 conf.d/linuxfr_saml_example delete mode 100644 rp_meyzieu/mappers/linuxfr_example.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5eeda39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.db +*.pyc +*.pyo diff --git a/conf.d/linuxfr_saml_example b/conf.d/linuxfr_saml_example deleted file mode 100644 index 7918032..0000000 --- a/conf.d/linuxfr_saml_example +++ /dev/null @@ -1,11 +0,0 @@ -{ - "site_name": "linuxfr", - "server_name": ["linuxfrsaml.local:8000"], - "location": "/", - "target": "https://linuxfr.org", - "mapper": "linuxfr", - "auth_type": "saml2", - "saml2_idp_metadata": "http://www.identity-hub.com/idp/saml2/metadata", - "saml2_signature_public_key": "certs/saml.crt", - "saml2_signature_private_key": "certs/saml.key" -} diff --git a/conf.d/portatil_famille b/conf.d/portatil_famille index 8025acb..c49a014 100644 --- a/conf.d/portatil_famille +++ b/conf.d/portatil_famille @@ -5,7 +5,7 @@ "target": "http://villes2.portail-familles.com:8080", "mapper": "portail_famille_ecities", "auth_type": "saml2", - "saml2_idp_metadata": "http://www.identity-hub.com/idp/saml2/metadata", + "saml2_idp_metadata": "https://sso-vincennes.dev.entrouvert.org/idp/saml2/metadata", "saml2_signature_public_key": "certs/saml.crt", "saml2_signature_private_key": "certs/saml.key" } diff --git a/rp_meyzieu/filters/portail_famille_ecitiz.py b/rp_meyzieu/filters/portail_famille_ecitiz.py index c414e2f..f00b803 100644 --- a/rp_meyzieu/filters/portail_famille_ecitiz.py +++ b/rp_meyzieu/filters/portail_famille_ecitiz.py @@ -1,11 +1,14 @@ +import urllib import re +from urlparse import parse_qs from mandaye.log import logger def associate(env, values, request, response): if response.msg and "', '
', + sub = re.subn(r'', + '', response.msg) response.msg = sub[0] if sub[1] != 1: @@ -19,3 +22,18 @@ def associate(env, values, request, response): logger.warning('Filter portail_famille_ecitiz.associate: submit replacement failed !') return response + +def clean_js(env, values, request, response): + if response.msg and 'alert("Veuillez, s' in response.msg: + response.msg = re.sub(r'