Skip to content
Snippets Groups Projects
Commit 720fb7e1 authored by Davide Vaghetti's avatar Davide Vaghetti
Browse files

Added script to retrieve identity federations contacts (both security and standard)

parent 70d01325
Branches master
No related tags found
1 merge request!5Master
#!/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()
print('FEDERATION,COUNTRIES,SECURITY CONTACT,FEDERATION CONTACT')
for fed in feds_dict:
if feds_dict[fed]['status'] == '6':
countries = ""
security_contact = ""
if 'security_contact' in feds_dict[fed]:
if 'mail' in feds_dict[fed]['security_contact']:
security_contact = feds_dict[fed]['security_contact']['mail']['value']
if 'countries' in feds_dict[fed]:
countries_array = feds_dict[fed]['countries']
for country in countries_array:
countries = countries + " " + country
print(f"{fed},{countries.strip()},{security_contact},{feds_dict[fed]['contact_email']}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment