Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
b1b2dd3b
Commit
b1b2dd3b
authored
Jun 28, 2020
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Fixed storing URN into HTML page_source file
parent
6514e28a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
api.py
+20
-20
20 additions, 20 deletions
api.py
eccs2.py
+35
-18
35 additions, 18 deletions
eccs2.py
eccs2properties.py
+14
-11
14 additions, 11 deletions
eccs2properties.py
web/script.js
+16
-8
16 additions, 8 deletions
web/script.js
with
85 additions
and
57 deletions
api.py
+
20
−
20
View file @
b1b2dd3b
...
...
@@ -153,12 +153,12 @@ class EccsResults(Resource):
# IdP-RegAuth; check[2]
# IdP-tech-ctc-1,IdP-tech-ctc-2; check[3]
# IdP-supp-ctc-1,IdP-supp-ctc-2; check[4]
# Status;
check[5]
# SP-
entityID-1;
check[6]
#
ECCS
Status; check[5]
# SP-
wayfless-url-1;
check[6]
# SP-check-time-1; check[7]
# SP-status-code-1; check[8]
# SP-status-1; check[9]
# SP-
entityID-2;
check[10]
# SP-
wayfless-url-2;
check[10]
# SP-check-time-2; check[11]
# SP-status-code-2 check[12]
# SP-status-2 check[13]
...
...
@@ -169,19 +169,19 @@ class EccsResults(Resource):
idp_reg_auth
=
check
[
2
]
idp_tech_ctcs
=
check
[
3
]
idp_supp_ctcs
=
check
[
4
]
idp_
ch
ec
k
s_status
=
check
[
5
]
sp1_
entity_id
=
check
[
6
]
idp_ec
c
s_status
=
check
[
5
]
sp1_
wayfless_url
=
check
[
6
]
sp1_check_time
=
check
[
7
]
sp1_status_code
=
check
[
8
]
sp1_check_status
=
check
[
9
]
sp2_
entity_id
=
check
[
10
]
sp2_
wayfless_url
=
check
[
10
]
sp2_check_time
=
check
[
11
]
sp2_status_code
=
check
[
12
]
sp2_check_status
=
check
[
13
].
rstrip
(
"
\n\r
"
)
if
(
idp
and
status
):
app
.
logger
.
info
(
"
eccsresults: check for
'
idp
'
:
'
%s
'
with
'
status
'
:
'
%s
'"
%
(
idp
,
status
))
if
(
idp
==
idp_entity_id
and
status
==
idp_
ch
ec
k
s_status
):
if
(
idp
==
idp_entity_id
and
status
==
idp_ec
c
s_status
):
result
.
append
(
{
'
displayName
'
:
idp_displayname
,
...
...
@@ -193,18 +193,18 @@ class EccsResults(Resource):
},
'
date
'
:
date
,
'
sp1
'
:
{
'
entityID
'
:
sp1_entity_id
,
'
wayfless_url
'
:
sp1_wayfless_url
,
'
checkTime
'
:
sp1_check_time
,
'
statusCode
'
:
sp1_status_code
,
'
status
'
:
sp1_check_status
},
'
sp2
'
:
{
'
entityID
'
:
sp2_entity_id
,
'
wayflessUrl
'
:
sp2_wayfless_url
,
'
checkTime
'
:
sp2_check_time
,
'
statusCode
'
:
sp2_status_code
,
'
status
'
:
sp2_check_status
},
'
status
'
:
idp_
ch
ec
k
s_status
'
status
'
:
idp_ec
c
s_status
}
)
elif
(
idp
):
#app.logger.info(re.search(".*."+idp+".*.", idp_entity_id, re.IGNORECASE))
...
...
@@ -222,22 +222,22 @@ class EccsResults(Resource):
},
'
date
'
:
date
,
'
sp1
'
:
{
'
entityID
'
:
sp1_entity_id
,
'
wayflessUrl
'
:
sp1_wayfless_url
,
'
checkTime
'
:
sp1_check_time
,
'
statusCode
'
:
sp1_status_code
,
'
status
'
:
sp1_check_status
},
'
sp2
'
:
{
'
entityID
'
:
sp2_entity_id
,
'
wayflessUrl
'
:
sp2_wayfless_url
,
'
checkTime
'
:
sp2_check_time
,
'
statusCode
'
:
sp2_status_code
,
'
status
'
:
sp2_check_status
},
'
status
'
:
idp_
ch
ec
k
s_status
'
status
'
:
idp_ec
c
s_status
}
)
elif
(
status
):
app
.
logger
.
info
(
"
eccsresults: Search for
'
status
'
:
'
%s
'
.
"
%
status
)
if
(
status
==
idp_
ch
ec
k
s_status
):
if
(
status
==
idp_ec
c
s_status
):
result
.
append
(
{
'
displayName
'
:
idp_displayname
,
...
...
@@ -249,18 +249,18 @@ class EccsResults(Resource):
},
'
date
'
:
date
,
'
sp1
'
:
{
'
entityID
'
:
sp1_entity_id
,
'
wayflessUrl
'
:
sp1_wayfless_url
,
'
checkTime
'
:
sp1_check_time
,
'
statusCode
'
:
sp1_status_code
,
'
status
'
:
sp1_check_status
},
'
sp2
'
:
{
'
entityID
'
:
sp2_entity_id
,
'
wayflessUrl
'
:
sp2_wayfless_url
,
'
checkTime
'
:
sp2_check_time
,
'
statusCode
'
:
sp2_status_code
,
'
status
'
:
sp2_check_status
},
'
status
'
:
idp_
ch
ec
k
s_status
'
status
'
:
idp_ec
c
s_status
}
)
else
:
result
.
append
(
...
...
@@ -274,18 +274,18 @@ class EccsResults(Resource):
},
'
date
'
:
date
,
'
sp1
'
:
{
'
entityID
'
:
sp1_entity_id
,
'
wayflessUrl
'
:
sp1_wayfless_url
,
'
checkTime
'
:
sp1_check_time
,
'
statusCode
'
:
sp1_status_code
,
'
status
'
:
sp1_check_status
},
'
sp2
'
:
{
'
entityID
'
:
sp2_entity_id
,
'
wayflessUrl
'
:
sp2_wayfless_url
,
'
checkTime
'
:
sp2_check_time
,
'
statusCode
'
:
sp2_status_code
,
'
status
'
:
sp2_check_status
},
'
status
'
:
idp_
ch
ec
k
s_status
'
status
'
:
idp_ec
c
s_status
}
)
if
(
pretty
):
...
...
...
...
This diff is collapsed.
Click to expand it.
eccs2.py
+
35
−
18
View file @
b1b2dd3b
...
...
@@ -25,6 +25,14 @@ The script has been written to simulate an user that inserts the IdP's entityID
If the IdP Login page presente the fields for both selected SP the test is passed, otherwise it is failed.
"""
# Returns the FQDN to use on the HTML page_source files
def
getIDPfqdn
(
entityIDidp
):
if
entityIDidp
.
startswith
(
'
http
'
):
return
parse_url
(
entityIDidp
)[
2
]
else
:
return
entityIDidp
.
split
(
"
:
"
)[
-
1
]
# The function check that the IdP recognized the SP by presenting its Login page.
# If the IdP Login page contains "username" and "password" fields, than the test is passed.
def
checkIdP
(
sp
,
idp
):
...
...
@@ -45,32 +53,40 @@ def checkIdP(sp,idp):
federation_blacklist
=
FEDS_BLACKLIST
entities_blacklist
=
IDPS_BLACKLIST
fqdn_idp
=
getIDPfqdn
(
idp
[
'
entityID
'
])
fqdn_sp
=
parse_url
(
sp
)[
2
]
wayfless_url
=
sp
+
idp
[
'
entityID
'
]
if
(
idp
[
'
registrationAuthority
'
]
in
federation_blacklist
):
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
"
NULL
"
,
"
DISABLED
"
)
with
open
(
"
%s/%s/%s---%s.html
"
%
(
ECCS2HTMLDIR
,
DAY
,
fqdn_idp
,
fqdn_sp
),
"
w
"
)
as
html
:
html
.
write
(
"
Federation excluded from check
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
"
NULL
"
,
"
DISABLED
"
)
if
(
idp
[
'
entityID
'
]
in
entities_blacklist
):
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
"
NULL
"
,
"
DISABLED
"
)
with
open
(
"
%s/%s/%s---%s.html
"
%
(
ECCS2HTMLDIR
,
DAY
,
fqdn_idp
,
fqdn_sp
),
"
w
"
)
as
html
:
html
.
write
(
"
Identity Provider excluded from check
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
"
NULL
"
,
"
DISABLED
"
)
# Open SP, select the IDP from the EDS and press 'Enter' to reach the IdP login page to check
try
:
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
driver
.
get
(
sp
)
element
=
WebDriverWait
(
driver
,
50
).
until
(
EC
.
presence_of_element_located
((
By
.
ID
,
"
idpSelectInput
"
)))
element
.
send_keys
(
idp
[
'
entityID
'
]
+
Keys
.
ENTER
)
driver
.
get
(
wayfless_url
)
page_source
=
driver
.
page_source
samlrequest_url
=
driver
.
current_url
# Put the page_source into its HTML file
Path
(
"
%s/%s
"
%
(
ECCS2HTMLDIR
,
DAY
)).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
fqdn_idp
=
parse_url
(
idp
[
'
entityID
'
])[
2
]
fqdn_sp
=
parse_url
(
sp
)[
2
]
# Put the page_source into an appropriate HTML file
with
open
(
"
%s/%s/%s---%s.html
"
%
(
ECCS2HTMLDIR
,
DAY
,
fqdn_idp
,
fqdn_sp
),
"
w
"
)
as
html
:
html
.
write
(
page_source
)
except
TimeoutException
as
e
:
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
"
(failed)
"
,
"
Timeout
"
)
# Put an empty string into the page_source file
with
open
(
"
%s/%s/%s---%s.html
"
%
(
ECCS2HTMLDIR
,
DAY
,
fqdn_idp
,
fqdn_sp
),
"
w
"
)
as
html
:
html
.
write
(
""
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
"
(failed)
"
,
"
Timeout
"
)
except
NoSuchElementException
as
e
:
# The input of the bootstrap tables are provided by "eccs2" and "eccs2checks" log.
...
...
@@ -142,13 +158,14 @@ def checkIdP(sp,idp):
status_code
=
"
555
"
if
(
metadata_not_found
):
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
status_code
,
"
No-eduGAIN-Metadata
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
status_code
,
"
No-eduGAIN-Metadata
"
)
elif
not
username_found
or
not
password_found
:
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
status_code
,
"
Invalid-Form
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
status_code
,
"
Invalid-Form
"
)
else
:
return
(
idp
[
'
entityID
'
],
sp
,
check_time
,
status_code
,
"
OK
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
status_code
,
"
OK
"
)
# Extract IdP DisplayName by fixing input string
def
getDisplayName
(
display_name
):
display_name_equal_splitted
=
display_name
.
split
(
'
==
'
)
for
elem
in
display_name_equal_splitted
:
...
...
@@ -170,7 +187,7 @@ def storeECCS2result(idp,check_results,idp_status):
str_technical_contacts
=
'
,
'
.
join
(
list_technical_contacts
)
str_support_contacts
=
'
,
'
.
join
(
list_support_contacts
)
# IdP-DisplayName;IdP-entityID;IdP-RegAuth;IdP-tech-ctc-1,IdP-tech-ctc-2;IdP-supp-ctc-1,IdP-supp-ctc-2;Status;SP-
entityID
-1;SP-check-time-1;SP-status-code-1;SP-result-1;SP-
entityID
-2;SP-check-time-2;SP-status-code-2;SP-result-2
# IdP-DisplayName;IdP-entityID;IdP-RegAuth;IdP-tech-ctc-1,IdP-tech-ctc-2;IdP-supp-ctc-1,IdP-supp-ctc-2;Status;SP-
wayfless-url
-1;SP-check-time-1;SP-status-code-1;SP-result-1;SP-
wayfless-url
-2;SP-check-time-2;SP-status-code-2;SP-result-2
with
open
(
"
%s/%s
"
%
(
ECCS2OUTPUTDIR
,
ECCS2RESULTSLOG
),
'
a
'
)
as
f
:
f
.
write
(
"
%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s
\n
"
%
(
getDisplayName
(
idp
[
'
displayname
'
]),
# IdP-DisplayName
...
...
@@ -179,11 +196,11 @@ def storeECCS2result(idp,check_results,idp_status):
str_technical_contacts
,
# IdP-TechCtcsList
str_support_contacts
,
# IdP-SuppCtcsList
idp_status
,
# IdP-ECCS-Status
check_results
[
0
][
1
],
# SP-
entityID
-1
check_results
[
0
][
1
],
# SP-
wayfless-url
-1
check_results
[
0
][
2
],
# SP-check-time-1
check_results
[
0
][
3
],
# SP-status-code-1
check_results
[
0
][
4
],
# SP-result-1
check_results
[
1
][
1
],
# SP-
entityID
-2
check_results
[
1
][
1
],
# SP-
wayfless-url
-2
check_results
[
1
][
2
],
# SP-check-time-2
check_results
[
1
][
3
],
# SP-status-code-2
check_results
[
1
][
4
]))
# SP-result-2
...
...
@@ -194,8 +211,6 @@ def check(idp,sps):
check_results
=
[]
for
sp
in
sps
:
result
=
checkIdP
(
sp
,
idp
)
# Se il checkIdP ha successo, aggiungo alla lista dei check
# altrimenti no.
if
result
is
not
None
:
check_results
.
append
(
result
)
...
...
@@ -228,4 +243,6 @@ if __name__=="__main__":
idp
=
json
.
loads
(
args
.
idpJson
[
0
])
Path
(
"
%s/%s
"
%
(
ECCS2HTMLDIR
,
DAY
)).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
# Create dir needed to page_source content
check
(
idp
,
sps
)
This diff is collapsed.
Click to expand it.
eccs2properties.py
+
14
−
11
View file @
b1b2dd3b
...
...
@@ -32,10 +32,10 @@ ECCS2STDERR = "%s/stderr_%s.log" % (ECCS2LOGSDIR,DAY)
ECCS2FAILEDCMD
=
"
%s/failed-cmd.sh
"
%
ECCS2LOGSDIR
# Number of processes to run in parallel
ECCS2NUMPROCESSES
=
2
0
ECCS2NUMPROCESSES
=
2
5
# The 2 SPs that will be used to test each IdP
ECCS2SPS
=
[
"
https://sp24-test.garr.it/
secure
"
,
"
https://attribute-viewer.aai.switch.ch/
eds/
"
]
ECCS2SPS
=
[
"
https://sp24-test.garr.it/
Shibboleth.sso/Login?entityID=
"
,
"
https://attribute-viewer.aai.switch.ch/
Shibboleth.sso/Login?entityID=
"
]
# Registration Authority of Federations to exclude from the check
FEDS_BLACKLIST
=
[
...
...
@@ -46,21 +46,24 @@ FEDS_BLACKLIST = [
# EntityID of IDPs to exclude from the check
IDPS_BLACKLIST
=
[
'
https://iif.iucc.ac.il/idp/saml2/idp/metadata.php
'
,
'
https://idp.eie.gr/idp/shibboleth
'
,
'
https://edugain-proxy.igtf.net/simplesaml/saml2/idp/metadata.php
'
,
'
https://gn-vho.grnet.gr/idp/shibboleth
'
,
'
https://wtc.tu-chemnitz.de/shibboleth
'
,
'
https://idp.utorauth.utoronto.ca/shibboleth
'
,
'
https://login.lstonline.ac.uk/idp/pingfederate
'
,
'
https://idp.pearsoncollege.com/openathens
'
,
'
https://idp.cambria.ac.uk/openathens
'
,
'
https://idp.wnsc.ac.uk/idp/shibboleth
'
,
'
https://indiid.net/idp/shibboleth
'
,
'
https://idp.nulc.ac.uk/openathens
'
,
'
https://lc-idp.lincolncollege.ac.uk/shibboleth
'
,
'
https://oa-idp.wlv.ac.uk/oala/metadata
'
,
'
https://idp.uel.ac.uk/shibboleth
'
,
'
https://boleth.chi.ac.uk/idp/shibboleth
'
,
'
https://idp.wnsc.ac.uk/idp/shibboleth
'
,
'
https://idp.strodes.ac.uk/shibboleth
'
,
'
https://idp.ucreative.ac.uk/shibboleth
'
,
'
https://idp.llandrillo.ac.uk/shibboleth
'
,
'
https://idp.uel.ac.uk/shibboleth
'
,
'
https://idp-dev.cardiff.ac.uk/idp/shibboleth
'
,
'
https://idp.kingston.ac.uk/shibboleth
'
,
# iframe to load
'
https://shibboleth.aber.ac.uk/shibboleth
'
,
'
https://sso.vu.lt/SSO/saml2/idp/metadata.php
'
,
# no standard login page
'
urn:mace:federation.org.au:testfed:uq.edu.au
'
'
https://sso.vu.lt/SSO/saml2/idp/metadata.php
'
,
#'https://ssl.education.lu/saml/saml2/idp/metadata.php',
'
https://iif.iucc.ac.il/idp/saml2/idp/metadata.php
'
]
This diff is collapsed.
Click to expand it.
web/script.js
+
16
−
8
View file @
b1b2dd3b
// use URL constructor and return hostname
function
getHostname
(
url
)
{
const
urlNew
=
new
URL
(
url
);
if
(
urlNew
.
hostname
){
return
urlNew
.
hostname
;
}
else
{
return
url
.
replace
(
/.+:/g
,
''
);
}
}
/* Formatting function for row details - modify as you need */
function
format
(
d
)
{
...
...
@@ -20,25 +25,28 @@ function format ( d ) {
'
<td>Support Contacts:</td>
'
+
'
<td>
'
+
d
.
contacts
.
support
+
'
</td>
'
+
'
<td>Check Time</td>
'
+
'
<td>Status Code</td>
'
+
'
<td>Result Check</td>
'
+
'
<td>Status Code</td>
'
+
'
<td>Page Source</td>
'
+
'
<td>Retry Check</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>SP1:</td>
'
+
'
<td>
'
+
d
.
sp1
.
entityID
+
'
</td>
'
+
'
<td>
https://
'
+
getHostname
(
d
.
sp1
.
wayflessUrl
)
+
'
</td>
'
+
'
<td>
'
+
d
.
sp1
.
checkTime
+
'
</td>
'
+
'
<td>
'
+
d
.
sp1
.
statusCode
+
'
</td>
'
+
'
<td>
'
+
d
.
sp1
.
status
+
'
</td>
'
+
'
<td><a href="/eccs2html/
'
+
d
.
date
+
'
/
'
+
getHostname
(
d
.
entityID
)
+
'
---
'
+
getHostname
(
d
.
sp1
.
entityID
)
+
'
.html" target="_blank">Click to open</a></td>
'
+
'
<td>
'
+
d
.
sp1
.
statusCode
+
'
</td>
'
+
'
<td><a href="/eccs2html/
'
+
d
.
date
+
'
/
'
+
getHostname
(
d
.
entityID
)
+
'
---
'
+
getHostname
(
d
.
sp1
.
wayflessUrl
)
+
'
.html" target="_blank">Click to open</a></td>
'
+
'
<td><a href="
'
+
d
.
sp1
.
wayflessUrl
+
'
" target="_blank">Click to retry</a></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>SP2:</td>
'
+
'
<td>
'
+
d
.
sp2
.
entityID
+
'
</td>
'
+
'
<td>
https://
'
+
getHostname
(
d
.
sp2
.
wayflessUrl
)
+
'
</td>
'
+
'
<td>
'
+
d
.
sp2
.
checkTime
+
'
</td>
'
+
'
<td>
'
+
d
.
sp2
.
statusCode
+
'
</td>
'
+
'
<td>
'
+
d
.
sp2
.
status
+
'
</td>
'
+
'
<td><a href="/eccs2html/
'
+
d
.
date
+
'
/
'
+
getHostname
(
d
.
entityID
)
+
'
---
'
+
getHostname
(
d
.
sp2
.
entityID
)
+
'
.html" target="_blank">Click to open</a></td>
'
+
'
<td>
'
+
d
.
sp2
.
statusCode
+
'
</td>
'
+
'
<td><a href="/eccs2html/
'
+
d
.
date
+
'
/
'
+
getHostname
(
d
.
entityID
)
+
'
---
'
+
getHostname
(
d
.
sp2
.
wayflessUrl
)
+
'
.html" target="_blank">Click to open</a></td>
'
+
'
<td><a href="
'
+
d
.
sp2
.
wayflessUrl
+
'
" target="_blank">Click to retry</a></td>
'
+
'
</tr>
'
+
'
</table>
'
;
}
...
...
...
...
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
sign in
to comment