From c9888aa67f8a1f9830a8444f98ffa0069c55e8ba Mon Sep 17 00:00:00 2001 From: Davide Vaghetti <davide.vaghetti@garr.it> Date: Fri, 4 Dec 2020 11:38:50 +0100 Subject: [PATCH] Added simple script to parse the security contacts of the eduGAIN identity federations --- edugain_security_contacts.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 edugain_security_contacts.py diff --git a/edugain_security_contacts.py b/edugain_security_contacts.py new file mode 100755 index 0000000..1e1c833 --- /dev/null +++ b/edugain_security_contacts.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# This script consume the eduGAIN API to retrieve the details of all the +# eduGAIN identity federations and parse it to create a list of +# security email addresses, if available, and the corresponding +# federation name in CSV format. +# This list will be printed to stdout. + +import requests + +feds = requests.get('https://technical.edugain.org/api.php?action=list_feds_full') + +feds_dict = feds.json() + +for fed in feds_dict: + if 'security_contact' in feds_dict[fed]: + if 'mail' in feds_dict[fed]['security_contact']: + print(f"{fed},{feds_dict[fed]['security_contact']['mail']['value']}") -- GitLab