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

Merge branch 'master' of gitlab.geant.org:davide.vaghetti/edugain-contacts

parents c23c4010 54e271f1
No related branches found
No related tags found
1 merge request!7Master
......@@ -3,6 +3,19 @@
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 contacts
Script name :`identity_federations_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 contacts per each federation in CSV format. This list will be printed to stdout.
CSV Format:
```
FEDERATION,COUNTRIES,SECURITY CONTACT,FEDERATION CONTACT
```
## Identity federations security contacts
Script name :`identity_federations_security_contacts.py`
......@@ -20,3 +33,44 @@ This script will download the current edugain metadata aggregate XML and parse a
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.
## Entities Details
Script: `entity_details.py`
This script will print out some details about a single entity or a list of entities
passed as a list of entityIDs.
CSV Format:
```
entityID,FederationName,RegistrationAuthority,OrganizationName,TechnicalContact,SupportContact,AdministrativeContact
```
Usage:
```
usage: entity_details.py [-h] [-e E] [-f F] [-u U] [ENTITYID]
Show detailed information about an eduGAIN entity.
positional arguments:
ENTITYID entityID of the entity to look up
options:
-h, --help show this help message and exit
-e E load entityIDs from file E
-f F load metadata from file F
-u U download metadata from url U (default to https://mds.edugain.org/edugain-v2.xml)
Examples
- Retrieve details about a single entity using eduGAIN metadata:
./entity_details.py https://idp.dir.garr.it/idp/shibboleth
- Retrieve details for a list of idps using a local metadata file:
./entity_details.py -e idp_list -f edugain-v2.xml
```
#!/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