diff --git a/README.md b/README.md index d7ef3866b092d5304362c910992eda5cfbe93900..19440f418112fcaef89f90c7025830e4cffef8a2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,22 @@ # eduGAIN Contacts -This script will download the current edugain metadata aggregate XML and parse it -to derive a list of contacts in CSV format. The list will be printed to stdout. +This repository contains tools to parse contacts from eduGAIN metadata and from +the eduGAIN APIs published on https://technical.edugain.org/api.php. + +## Identity federations security contacts + +Script name :`identity_federations_security_contacts.py` + +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. + + +## Entities security contacts + +Script: `entities_security_contacts.py` + +This script will download the current edugain metadata aggregate XML and parse all the +identity providers found in order to derive a list of Organization names, domains and +security contacts in CSV format. This list will be printed to stdout. + diff --git a/edugain_contacts.py b/entities_security_contacts.py old mode 100644 new mode 100755 similarity index 98% rename from edugain_contacts.py rename to entities_security_contacts.py index 85daa847f2574f532f06460e431bce9b540f5adb..d718fdedaa40db41d97d941cb90e448bf9e73997 --- a/edugain_contacts.py +++ b/entities_security_contacts.py @@ -6,7 +6,6 @@ import requests from xml.etree import ElementTree as ET -from urllib.parse import urlparse def strip_start(s, start): diff --git a/identity_federations_security_contacts.py b/identity_federations_security_contacts.py new file mode 100755 index 0000000000000000000000000000000000000000..1e1c83386fd3b5bf310b149c437e5b26a6e9f1c0 --- /dev/null +++ b/identity_federations_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']}")