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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
e7ab4c77
Commit
e7ab4c77
authored
4 years ago
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Added IdP disabling mode by eccs-disabled.txt file on his web root
parent
c26ccdd1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eccs2.py
+30
-0
30 additions, 0 deletions
eccs2.py
with
30 additions
and
0 deletions
eccs2.py
+
30
−
0
View file @
e7ab4c77
...
@@ -51,6 +51,36 @@ def checkIdP(sp,idp,test):
...
@@ -51,6 +51,36 @@ def checkIdP(sp,idp,test):
fqdn_sp
=
parse_url
(
sp
)[
2
]
fqdn_sp
=
parse_url
(
sp
)[
2
]
wayfless_url
=
sp
+
idp
[
'
entityID
'
]
wayfless_url
=
sp
+
idp
[
'
entityID
'
]
exclude_idp
=
""
try
:
headers
=
{
'
User-Agent
'
:
'
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
'
}
exclude_idp
=
requests
.
get
(
"
https://%s/eccs-disabled.txt
"
%
fqdn_idp
,
headers
=
headers
,
verify
=
False
,
timeout
=
30
)
if
(
exclude_idp
==
""
):
exclude_idp
=
requests
.
get
(
"
http://%s/eccs-disabled.txt
"
%
fqdn_idp
,
headers
=
headers
,
verify
=
False
,
timeout
=
30
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
print
(
"
!!! ECCS-DISABLED REQUESTS CONNECTION ERROR EXCEPTION !!!
"
)
#print (e.__str__())
exclude_idp
=
""
except
requests
.
exceptions
.
Timeout
as
e
:
print
(
"
!!! ECCS-DISABLED REQUESTS TIMEOUT EXCEPTION !!!
"
)
#print (e.__str__())
exclude_idp
=
""
if
(
exclude_idp
):
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
if
(
test
is
not
True
):
with
open
(
"
%s/%s/%s---%s.html
"
%
(
ECCS2HTMLDIR
,
DAY
,
fqdn_idp
,
fqdn_sp
),
"
w
"
)
as
html
:
html
.
write
(
"
IdP excluded from check by eccs-disabled.txt
"
)
else
:
print
(
"
IdP excluded from check by eccs-disabled.txt
"
)
return
(
idp
[
'
entityID
'
],
wayfless_url
,
check_time
,
"
NULL
"
,
"
DISABLED
"
)
if
(
idp
[
'
registrationAuthority
'
]
in
federation_blacklist
):
if
(
idp
[
'
registrationAuthority
'
]
in
federation_blacklist
):
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
check_time
=
datetime
.
datetime
.
utcnow
().
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
'
Z
'
...
...
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