Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN contacts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN contacts
Commits
e8eaf73f
Commit
e8eaf73f
authored
4 years ago
by
Davide Vaghetti
Browse files
Options
Downloads
Patches
Plain Diff
Removed non authoritative domains element (as DomainHint)
parent
9bdc0095
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Removed non authoritative domains element (as DomainHint)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
edugain_contacts.py
+5
-14
5 additions, 14 deletions
edugain_contacts.py
with
5 additions
and
14 deletions
edugain_contacts.py
+
5
−
14
View file @
e8eaf73f
...
...
@@ -57,21 +57,12 @@ for entity in entities:
contact_txt
=
'"
{}
"
<{}>
'
.
format
(
name
,
mail
)
else
:
contact_txt
=
mail
doms
=
entity
.
findall
(
'
./md:IDPSSODescriptor/md:Extensions/mdui:DiscoHints/mdui:DomainHint
'
,
ns
)
+
\
entity
.
findall
(
'
./md:IDPSSODescriptor/md:Extensions/shibmd:Scope[@regexp=
"
false
"
]
'
,
ns
)
doms
=
{
strip_start
(
dom
.
text
,
'
www.
'
)
for
dom
in
doms
}
if
len
(
doms
)
==
0
:
orgurl
=
entity
.
find
(
'
./md:Organization/md:OrganizationURL
'
,
ns
)
if
orgurl
is
None
:
continue
baseurl
=
strip_start
(
urlparse
(
orgurl
.
text
).
netloc
,
'
www.
'
)
if
'
:
'
in
baseurl
:
baseurl
=
baseurl
.
split
(
'
:
'
)[
0
]
doms
=
{
baseurl
}
doms
=
entity
.
findall
(
'
./md:IDPSSODescriptor/md:Extensions/shibmd:Scope[@regexp=
"
false
"
]
'
,
ns
)
for
domain
in
doms
:
if
domain
not
in
seen_doms
:
seen_doms
.
add
(
domain
)
contacts
.
add
(
'
{},{},{}
'
.
format
(
domain
,
contact_txt
,
orgname
))
domain_text
=
domain
.
text
if
domain_text
not
in
seen_doms
:
seen_doms
.
add
(
domain_text
)
contacts
.
add
(
'
{},{},{}
'
.
format
(
domain_text
,
contact_txt
,
orgname
))
for
contact
in
sorted
(
contacts
):
print
(
contact
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment